ci: use prerelease logic (#2553)
This commit is contained in:
parent
26ceec5f3c
commit
e898be1b7e
26 changed files with 450 additions and 1194 deletions
6
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
6
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
|
|
@ -24,10 +24,10 @@ body:
|
|||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is your issue present in the nightly release?
|
||||
description: Please test the [nightly](https://github.com/LizardByte/Sunshine/releases/tag/nightly-dev) release
|
||||
label: Is your issue present in the latest beta/pre-release?
|
||||
description: Please test the latest [pre-release](https://github.com/LizardByte/Sunshine/releases)
|
||||
options:
|
||||
- label: This issue is present in the nightly release
|
||||
- label: This issue is present in the latest pre-release
|
||||
required: true
|
||||
- type: textarea
|
||||
id: description
|
||||
|
|
|
|||
273
.github/workflows/CI.yml
vendored
273
.github/workflows/CI.yml
vendored
|
|
@ -3,14 +3,14 @@ name: CI
|
|||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master, nightly]
|
||||
branches: [master]
|
||||
types: [opened, synchronize, reopened]
|
||||
push:
|
||||
branches: [master, nightly]
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
|
@ -25,102 +25,23 @@ jobs:
|
|||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
|
||||
check_changelog:
|
||||
name: Check Changelog
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Verify Changelog
|
||||
id: verify_changelog
|
||||
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
|
||||
# base_ref for pull request check, ref for push
|
||||
uses: LizardByte/.github/actions/verify_changelog@master
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
outputs:
|
||||
next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }}
|
||||
next_version_bare: ${{ steps.verify_changelog.outputs.changelog_parser_version_bare }}
|
||||
last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }}
|
||||
release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }}
|
||||
|
||||
# todo - remove this job once versioning is fully automated by cmake
|
||||
check_versions:
|
||||
name: Check Versions
|
||||
runs-on: ubuntu-latest
|
||||
needs: check_changelog
|
||||
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
|
||||
# base_ref for pull request check, ref for push
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check CMakeLists.txt Version
|
||||
run: |
|
||||
version=$(grep -o -E '^project\(Sunshine VERSION [0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt | \
|
||||
grep -o -E '[0-9]+\.[0-9]+\.[0-9]+')
|
||||
echo "cmakelists_version=${version}" >> $GITHUB_ENV
|
||||
|
||||
- name: Compare CMakeList.txt Version
|
||||
if: ${{ env.cmakelists_version != needs.check_changelog.outputs.next_version_bare }}
|
||||
run: |
|
||||
echo CMakeLists version: "$cmakelists_version"
|
||||
echo Changelog version: "${{ needs.check_changelog.outputs.next_version_bare }}"
|
||||
echo Within 'CMakeLists.txt' change "project(Sunshine [VERSION $cmakelists_version]" to \
|
||||
"project(Sunshine [VERSION ${{ needs.check_changelog.outputs.next_version_bare }}]"
|
||||
exit 1
|
||||
|
||||
setup_release:
|
||||
name: Setup Release
|
||||
needs: check_changelog
|
||||
outputs:
|
||||
publish_release: ${{ steps.setup_release.outputs.publish_release }}
|
||||
release_commit: ${{ steps.setup_release.outputs.release_commit }}
|
||||
release_tag: ${{ steps.setup_release.outputs.release_tag }}
|
||||
release_version: ${{ steps.setup_release.outputs.release_version }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set release details
|
||||
id: release_details
|
||||
env:
|
||||
RELEASE_BODY: ${{ needs.check_changelog.outputs.release_body }}
|
||||
run: |
|
||||
# determine to create a release or not
|
||||
if [[ $GITHUB_EVENT_NAME == "push" ]]; then
|
||||
RELEASE=true
|
||||
else
|
||||
RELEASE=false
|
||||
fi
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# set the release tag
|
||||
COMMIT=${{ github.sha }}
|
||||
if [[ $GITHUB_REF == refs/heads/master ]]; then
|
||||
TAG="${{ needs.check_changelog.outputs.next_version }}"
|
||||
RELEASE_NAME="${{ needs.check_changelog.outputs.next_version }}"
|
||||
RELEASE_BODY="$RELEASE_BODY"
|
||||
PRE_RELEASE="false"
|
||||
elif [[ $GITHUB_REF == refs/heads/nightly ]]; then
|
||||
TAG="nightly-dev"
|
||||
RELEASE_NAME="nightly"
|
||||
RELEASE_BODY="automated nightly release - $(date -u +'%Y-%m-%dT%H:%M:%SZ') - ${COMMIT}"
|
||||
PRE_RELEASE="true"
|
||||
fi
|
||||
|
||||
echo "create_release=${RELEASE}" >> $GITHUB_OUTPUT
|
||||
echo "release_tag=${TAG}" >> $GITHUB_OUTPUT
|
||||
echo "release_commit=${COMMIT}" >> $GITHUB_OUTPUT
|
||||
echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT
|
||||
echo "pre_release=${PRE_RELEASE}" >> $GITHUB_OUTPUT
|
||||
|
||||
# this is stupid but works for multiline strings
|
||||
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
|
||||
echo "$RELEASE_BODY" >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
|
||||
outputs:
|
||||
create_release: ${{ steps.release_details.outputs.create_release }}
|
||||
release_tag: ${{ steps.release_details.outputs.release_tag }}
|
||||
release_commit: ${{ steps.release_details.outputs.release_commit }}
|
||||
release_name: ${{ steps.release_details.outputs.release_name }}
|
||||
release_body: ${{ env.RELEASE_BODY }}
|
||||
pre_release: ${{ steps.release_details.outputs.pre_release }}
|
||||
- name: Setup Release
|
||||
id: setup_release
|
||||
uses: LizardByte/setup-release-action@v2024.524.1411
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
setup_flatpak_matrix:
|
||||
name: Setup Flatpak Matrix
|
||||
|
|
@ -131,7 +52,7 @@ jobs:
|
|||
# https://www.cynkra.com/blog/2020-12-23-dynamic-gha
|
||||
run: |
|
||||
# determine which architectures to build
|
||||
if [[ $GITHUB_EVENT_NAME == "push" ]]; then
|
||||
if [[ "${{ github.event_name }}" == "push" ]]; then
|
||||
matrix=$((
|
||||
echo '{ "arch" : ["x86_64", "aarch64"] }'
|
||||
) | jq -c .)
|
||||
|
|
@ -158,7 +79,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@v8
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 10240
|
||||
remove-dotnet: 'true'
|
||||
|
|
@ -194,7 +115,7 @@ jobs:
|
|||
"
|
||||
|
||||
- name: Cache Flatpak build
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./build/.flatpak-builder
|
||||
key: flatpak-${{ matrix.arch }}-${{ github.sha }}
|
||||
|
|
@ -204,19 +125,18 @@ jobs:
|
|||
- name: Configure Flatpak Manifest
|
||||
run: |
|
||||
# variables for manifest
|
||||
branch=${GITHUB_HEAD_REF}
|
||||
branch=${{ github.head_ref }}
|
||||
commit=${{ needs.setup_release.outputs.release_commit }}
|
||||
|
||||
# check the branch variable
|
||||
if [ -z "$branch" ]
|
||||
then
|
||||
echo "This is a PUSH event"
|
||||
branch=${{ github.ref_name }}
|
||||
build_version=${{ needs.check_changelog.outputs.next_version }}
|
||||
commit=${{ github.sha }}
|
||||
build_version=${{ needs.setup_release.outputs.release_tag }}
|
||||
clone_url=${{ github.event.repository.clone_url }}
|
||||
else
|
||||
echo "This is a PR event"
|
||||
commit=${{ github.event.pull_request.head.sha }}
|
||||
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
|
||||
fi
|
||||
echo "Branch: ${branch}"
|
||||
|
|
@ -257,23 +177,21 @@ jobs:
|
|||
path: artifacts/
|
||||
|
||||
- name: Create/Update GitHub Release
|
||||
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
|
||||
uses: ncipollo/release-action@v1
|
||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
|
||||
uses: LizardByte/create-release-action@v2024.520.211408
|
||||
with:
|
||||
name: ${{ needs.setup_release.outputs.release_name }}
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
commit: ${{ needs.setup_release.outputs.release_commit }}
|
||||
artifacts: "*artifacts/*"
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
allowUpdates: true
|
||||
body: ${{ needs.setup_release.outputs.release_body }}
|
||||
discussionCategory: announcements
|
||||
prerelease: ${{ needs.setup_release.outputs.pre_release }}
|
||||
generateReleaseNotes: true
|
||||
name: ${{ needs.setup_release.outputs.release_tag }}
|
||||
prerelease: true
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
build_linux:
|
||||
name: Linux ${{ matrix.type }}
|
||||
runs-on: ubuntu-${{ matrix.dist }}
|
||||
needs: [check_changelog, setup_release]
|
||||
needs: [setup_release]
|
||||
strategy:
|
||||
fail-fast: false # false to test all, true to fail entire job if any fail
|
||||
matrix:
|
||||
|
|
@ -284,7 +202,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@v8
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 30720
|
||||
remove-dotnet: 'true'
|
||||
|
|
@ -403,8 +321,8 @@ jobs:
|
|||
- name: Build Linux
|
||||
env:
|
||||
BRANCH: ${{ github.head_ref || github.ref_name }}
|
||||
BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version }}
|
||||
COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
BUILD_VERSION: ${{ needs.setup_release.outputs.release_tag }}
|
||||
COMMIT: ${{ needs.setup_release.outputs.release_commit }}
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
echo "nproc: $(nproc)"
|
||||
|
|
@ -430,10 +348,9 @@ jobs:
|
|||
|
||||
- name: Set AppImage Version
|
||||
if: |
|
||||
matrix.type == 'AppImage' &&
|
||||
(needs.check_changelog.outputs.next_version_bare != needs.check_changelog.outputs.last_version)
|
||||
matrix.type == 'AppImage'
|
||||
run: |
|
||||
version=${{ needs.check_changelog.outputs.next_version_bare }}
|
||||
version=${{ needs.setup_release.outputs.release_tag }}
|
||||
echo "VERSION=${version}" >> $GITHUB_ENV
|
||||
|
||||
- name: Package Linux - AppImage
|
||||
|
|
@ -550,21 +467,19 @@ jobs:
|
|||
verbose: true
|
||||
|
||||
- name: Create/Update GitHub Release
|
||||
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
|
||||
uses: ncipollo/release-action@v1
|
||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
|
||||
uses: LizardByte/create-release-action@v2024.520.211408
|
||||
with:
|
||||
name: ${{ needs.setup_release.outputs.release_name }}
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
commit: ${{ needs.setup_release.outputs.release_commit }}
|
||||
artifacts: "*artifacts/*"
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
allowUpdates: true
|
||||
body: ${{ needs.setup_release.outputs.release_body }}
|
||||
discussionCategory: announcements
|
||||
prerelease: ${{ needs.setup_release.outputs.pre_release }}
|
||||
generateReleaseNotes: true
|
||||
name: ${{ needs.setup_release.outputs.release_tag }}
|
||||
prerelease: true
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
build_mac_brew:
|
||||
needs: [check_changelog, setup_release]
|
||||
needs: [setup_release]
|
||||
strategy:
|
||||
fail-fast: false # false to test all, true to fail entire job if any fail
|
||||
matrix:
|
||||
|
|
@ -590,22 +505,21 @@ jobs:
|
|||
- name: Configure formula
|
||||
run: |
|
||||
# variables for formula
|
||||
branch=${GITHUB_HEAD_REF}
|
||||
branch=${{ github.head_ref }}
|
||||
commit=${{ needs.setup_release.outputs.release_commit }}
|
||||
|
||||
# check the branch variable
|
||||
if [ -z "$branch" ]
|
||||
then
|
||||
echo "This is a PUSH event"
|
||||
build_version=${{ needs.check_changelog.outputs.next_version }}
|
||||
build_version=${{ needs.setup_release.outputs.release_tag }}
|
||||
clone_url=${{ github.event.repository.clone_url }}
|
||||
branch="${{ github.ref_name }}"
|
||||
commit=${{ github.sha }}
|
||||
default_branch="${{ github.event.repository.default_branch }}"
|
||||
else
|
||||
echo "This is a PR event"
|
||||
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
|
||||
branch="${{ github.event.pull_request.head.ref }}"
|
||||
commit=${{ github.event.pull_request.head.sha }}
|
||||
default_branch="${{ github.event.pull_request.head.repo.default_branch }}"
|
||||
fi
|
||||
echo "Branch: ${branch}"
|
||||
|
|
@ -638,32 +552,31 @@ jobs:
|
|||
name: sunshine-homebrew
|
||||
path: homebrew/
|
||||
|
||||
- name: Should Publish Homebrew Formula
|
||||
id: homebrew_publish
|
||||
run: |
|
||||
PUBLISH=false
|
||||
if [[ \
|
||||
"${{ matrix.release }}" == "true" && \
|
||||
"${{ github.repository_owner }}" == "LizardByte" && \
|
||||
"${{ needs.setup_release.outputs.create_release }}" == "true" && \
|
||||
"${{ github.ref }}" == "refs/heads/master" \
|
||||
]]; then
|
||||
PUBLISH=true
|
||||
fi
|
||||
|
||||
echo "publish=${PUBLISH}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Validate and Publish Homebrew Formula
|
||||
uses: LizardByte/homebrew-release-action@v2024.516.191449
|
||||
- name: Validate Homebrew Formula
|
||||
uses: LizardByte/homebrew-release-action@v2024.522.222851
|
||||
with:
|
||||
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
|
||||
git_email: ${{ secrets.GH_BOT_EMAIL }}
|
||||
git_username: ${{ secrets.GH_BOT_NAME }}
|
||||
publish: ${{ steps.homebrew_publish.outputs.publish }}
|
||||
publish: false
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
validate: true
|
||||
|
||||
- name: Create/Update GitHub Release
|
||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
|
||||
uses: LizardByte/create-release-action@v2024.520.211408
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts: '${{ github.workspace }}/homebrew/*'
|
||||
discussionCategory: announcements
|
||||
generateReleaseNotes: true
|
||||
name: ${{ needs.setup_release.outputs.release_tag }}
|
||||
prerelease: true
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
build_mac_port:
|
||||
needs: [check_changelog, setup_release]
|
||||
needs: [setup_release]
|
||||
strategy:
|
||||
fail-fast: false # false to test all, true to fail entire job if any fail
|
||||
matrix:
|
||||
|
|
@ -708,19 +621,18 @@ jobs:
|
|||
- name: Configure Portfile
|
||||
run: |
|
||||
# variables for Portfile
|
||||
branch=${GITHUB_HEAD_REF}
|
||||
branch=${{ github.head_ref }}
|
||||
commit=${{ needs.setup_release.outputs.release_commit }}
|
||||
|
||||
# check the branch variable
|
||||
if [ -z "$branch" ]
|
||||
then
|
||||
echo "This is a PUSH event"
|
||||
branch="${{ github.ref_name }}"
|
||||
build_version=${{ needs.check_changelog.outputs.next_version }}
|
||||
commit=${{ github.sha }}
|
||||
build_version=${{ needs.setup_release.outputs.release_tag }}
|
||||
clone_url=${{ github.event.repository.clone_url }}
|
||||
else
|
||||
echo "This is a PR event"
|
||||
commit=${{ github.event.pull_request.head.sha }}
|
||||
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
|
||||
fi
|
||||
echo "Commit: ${commit}"
|
||||
|
|
@ -892,23 +804,21 @@ jobs:
|
|||
verbose: true
|
||||
|
||||
- name: Create/Update GitHub Release
|
||||
if: ${{ needs.setup_release.outputs.create_release == 'true' && matrix.release }}
|
||||
uses: ncipollo/release-action@v1
|
||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
|
||||
uses: LizardByte/create-release-action@v2024.520.211408
|
||||
with:
|
||||
name: ${{ needs.setup_release.outputs.release_name }}
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
commit: ${{ needs.setup_release.outputs.release_commit }}
|
||||
artifacts: "*artifacts/*"
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
allowUpdates: true
|
||||
body: ${{ needs.setup_release.outputs.release_body }}
|
||||
discussionCategory: announcements
|
||||
prerelease: ${{ needs.setup_release.outputs.pre_release }}
|
||||
generateReleaseNotes: true
|
||||
name: ${{ needs.setup_release.outputs.release_tag }}
|
||||
prerelease: true
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
build_win:
|
||||
name: Windows
|
||||
runs-on: windows-2019
|
||||
needs: [check_changelog, setup_release]
|
||||
needs: [setup_release]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
|
@ -1069,8 +979,8 @@ jobs:
|
|||
shell: msys2 {0}
|
||||
env:
|
||||
BRANCH: ${{ github.head_ref || github.ref_name }}
|
||||
BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version }}
|
||||
COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
BUILD_VERSION: ${{ needs.setup_release.outputs.release_tag }}
|
||||
COMMIT: ${{ needs.setup_release.outputs.release_commit }}
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
|
|
@ -1157,32 +1067,13 @@ jobs:
|
|||
path: artifacts/
|
||||
|
||||
- name: Create/Update GitHub Release
|
||||
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
|
||||
uses: ncipollo/release-action@v1
|
||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
|
||||
uses: LizardByte/create-release-action@v2024.520.211408
|
||||
with:
|
||||
name: ${{ needs.setup_release.outputs.release_name }}
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
commit: ${{ needs.setup_release.outputs.release_commit }}
|
||||
artifacts: "*artifacts/*"
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
allowUpdates: true
|
||||
body: ${{ needs.setup_release.outputs.release_body }}
|
||||
discussionCategory: announcements
|
||||
prerelease: ${{ needs.setup_release.outputs.pre_release }}
|
||||
|
||||
release-winget:
|
||||
name: Release to WinGet
|
||||
needs: [setup_release, build_win]
|
||||
if: |
|
||||
(github.repository_owner == 'LizardByte' &&
|
||||
needs.setup_release.outputs.create_release == 'true' &&
|
||||
github.ref == 'refs/heads/master')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Release to WinGet
|
||||
uses: vedantmgoyal2009/winget-releaser@v2
|
||||
with:
|
||||
identifier: LizardByte.Sunshine
|
||||
release-tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
installers-regex: '\.exe$' # only .exe files
|
||||
generateReleaseNotes: true
|
||||
name: ${{ needs.setup_release.outputs.release_tag }}
|
||||
prerelease: true
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
|
|
|||
157
.github/workflows/ci-docker.yml
vendored
157
.github/workflows/ci-docker.yml
vendored
|
|
@ -29,7 +29,7 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
|
@ -74,82 +74,49 @@ jobs:
|
|||
echo $matrix | jq .
|
||||
echo "matrix=$matrix" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Find dotnet solution file
|
||||
id: find_dotnet
|
||||
run: |
|
||||
solution=$(find . -maxdepth 1 -type f -iname "*.sln")
|
||||
|
||||
echo "found solution: ${solution}"
|
||||
|
||||
# do not quote to keep this as a single line
|
||||
echo solution=${solution} >> $GITHUB_OUTPUT
|
||||
|
||||
if [[ $solution != "" ]]; then
|
||||
echo "dotnet=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "dotnet=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
outputs:
|
||||
dockerfiles: ${{ steps.find.outputs.dockerfiles }}
|
||||
matrix: ${{ steps.find.outputs.matrix }}
|
||||
dotnet: ${{ steps.find_dotnet.outputs.dotnet }}
|
||||
solution: ${{ steps.find_dotnet.outputs.solution }}
|
||||
|
||||
check_changelog:
|
||||
name: Check Changelog
|
||||
needs: [check_dockerfiles]
|
||||
setup_release:
|
||||
if: ${{ needs.check_dockerfiles.outputs.dockerfiles }}
|
||||
name: Setup Release
|
||||
needs:
|
||||
- check_dockerfiles
|
||||
outputs:
|
||||
publish_release: ${{ steps.setup_release.outputs.publish_release }}
|
||||
release_commit: ${{ steps.setup_release.outputs.release_commit }}
|
||||
release_tag: ${{ steps.setup_release.outputs.release_tag }}
|
||||
release_version: ${{ steps.setup_release.outputs.release_version }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Verify Changelog
|
||||
id: verify_changelog
|
||||
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
|
||||
# base_ref for pull request check, ref for push
|
||||
uses: LizardByte/.github/actions/verify_changelog@master
|
||||
- name: Setup Release
|
||||
id: setup_release
|
||||
uses: LizardByte/setup-release-action@v2024.524.1411
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
outputs:
|
||||
next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }}
|
||||
next_version_bare: ${{ steps.verify_changelog.outputs.changelog_parser_version_bare }}
|
||||
last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }}
|
||||
release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }}
|
||||
|
||||
setup_release:
|
||||
name: Setup Release
|
||||
needs: check_changelog
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set release details
|
||||
id: release_details
|
||||
env:
|
||||
RELEASE_BODY: ${{ needs.check_changelog.outputs.release_body }}
|
||||
run: |
|
||||
# determine to create a release or not
|
||||
if [[ $GITHUB_EVENT_NAME == "push" ]]; then
|
||||
RELEASE=true
|
||||
else
|
||||
RELEASE=false
|
||||
fi
|
||||
|
||||
# set the release tag
|
||||
COMMIT=${{ github.sha }}
|
||||
if [[ $GITHUB_REF == refs/heads/master ]]; then
|
||||
TAG="${{ needs.check_changelog.outputs.next_version }}"
|
||||
RELEASE_NAME="${{ needs.check_changelog.outputs.next_version }}"
|
||||
RELEASE_BODY="$RELEASE_BODY"
|
||||
PRE_RELEASE="false"
|
||||
elif [[ $GITHUB_REF == refs/heads/nightly ]]; then
|
||||
TAG="nightly-dev"
|
||||
RELEASE_NAME="nightly"
|
||||
RELEASE_BODY="automated nightly release - $(date -u +'%Y-%m-%dT%H:%M:%SZ') - ${COMMIT}"
|
||||
PRE_RELEASE="true"
|
||||
fi
|
||||
|
||||
echo "create_release=${RELEASE}" >> $GITHUB_OUTPUT
|
||||
echo "release_tag=${TAG}" >> $GITHUB_OUTPUT
|
||||
echo "release_commit=${COMMIT}" >> $GITHUB_OUTPUT
|
||||
echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT
|
||||
echo "pre_release=${PRE_RELEASE}" >> $GITHUB_OUTPUT
|
||||
|
||||
# this is stupid but works for multiline strings
|
||||
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
|
||||
echo "$RELEASE_BODY" >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
|
||||
outputs:
|
||||
create_release: ${{ steps.release_details.outputs.create_release }}
|
||||
release_tag: ${{ steps.release_details.outputs.release_tag }}
|
||||
release_commit: ${{ steps.release_details.outputs.release_commit }}
|
||||
release_name: ${{ steps.release_details.outputs.release_name }}
|
||||
release_body: ${{ env.RELEASE_BODY }}
|
||||
pre_release: ${{ steps.release_details.outputs.pre_release }}
|
||||
dotnet: ${{ needs.check_dockerfiles.outputs.dotnet }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
lint_dockerfile:
|
||||
needs: [check_dockerfiles]
|
||||
|
|
@ -180,7 +147,7 @@ jobs:
|
|||
cat "./hadolint.log" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
docker:
|
||||
needs: [check_dockerfiles, check_changelog, setup_release]
|
||||
needs: [check_dockerfiles, setup_release]
|
||||
if: ${{ needs.check_dockerfiles.outputs.dockerfiles }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
|
|
@ -193,7 +160,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@v8
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 30720 # https://github.com/easimon/maximize-build-space#caveats
|
||||
remove-dotnet: 'true'
|
||||
|
|
@ -210,24 +177,20 @@ jobs:
|
|||
- name: Prepare
|
||||
id: prepare
|
||||
env:
|
||||
NV: ${{ needs.check_changelog.outputs.next_version }}
|
||||
NV: ${{ needs.setup_release.outputs.release_tag }}
|
||||
run: |
|
||||
# get branch name
|
||||
BRANCH=${GITHUB_HEAD_REF}
|
||||
|
||||
RELEASE=false
|
||||
RELEASE=${{ needs.setup_release.outputs.publish_release }}
|
||||
COMMIT=${{ needs.setup_release.outputs.release_commit }}
|
||||
|
||||
if [ -z "$BRANCH" ]; then
|
||||
echo "This is a PUSH event"
|
||||
BRANCH=${{ github.ref_name }}
|
||||
COMMIT=${{ github.sha }}
|
||||
CLONE_URL=${{ github.event.repository.clone_url }}
|
||||
if [[ $BRANCH == "master" ]]; then
|
||||
RELEASE=true
|
||||
fi
|
||||
else
|
||||
echo "This is a PULL REQUEST event"
|
||||
COMMIT=${{ github.event.pull_request.head.sha }}
|
||||
CLONE_URL=${{ github.event.pull_request.head.repo.clone_url }}
|
||||
fi
|
||||
|
||||
|
|
@ -260,7 +223,7 @@ jobs:
|
|||
# parse custom directives out of dockerfile
|
||||
# try to get the platforms from the dockerfile custom directive, i.e. `# platforms: xxx,yyy`
|
||||
# directives for PR event, i.e. not push event
|
||||
if [[ ${PUSH} == "false" ]]; then
|
||||
if [[ ${RELEASE} == "false" ]]; then
|
||||
while read -r line; do
|
||||
if [[ $line == "# platforms_pr: "* && $PLATFORMS == "" ]]; then
|
||||
# echo the line and use `sed` to remove the custom directive
|
||||
|
|
@ -299,13 +262,10 @@ jobs:
|
|||
|
||||
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
|
||||
echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
||||
echo "commit=${COMMIT}" >> $GITHUB_OUTPUT
|
||||
echo "clone_url=${CLONE_URL}" >> $GITHUB_OUTPUT
|
||||
echo "release=${RELEASE}" >> $GITHUB_OUTPUT
|
||||
echo "artifacts=${ARTIFACTS}" >> $GITHUB_OUTPUT
|
||||
echo "no_cache_filters=${NO_CACHE_FILTERS}" >> $GITHUB_OUTPUT
|
||||
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
|
||||
echo "push=${PUSH}" >> $GITHUB_OUTPUT
|
||||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set Up QEMU
|
||||
|
|
@ -316,7 +276,7 @@ jobs:
|
|||
id: buildx
|
||||
|
||||
- name: Cache Docker Layers
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: Docker-buildx${{ matrix.tag }}-${{ github.sha }}
|
||||
|
|
@ -324,14 +284,14 @@ jobs:
|
|||
Docker-buildx${{ matrix.tag }}-
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets
|
||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Log in to the Container registry
|
||||
if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets
|
||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
|
|
@ -352,10 +312,10 @@ jobs:
|
|||
build-args: |
|
||||
BRANCH=${{ steps.prepare.outputs.branch }}
|
||||
BUILD_DATE=${{ steps.prepare.outputs.build_date }}
|
||||
BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }}
|
||||
COMMIT=${{ steps.prepare.outputs.commit }}
|
||||
BUILD_VERSION=${{ needs.setup_release.outputs.release_tag }}
|
||||
COMMIT=${{ needs.setup_release.outputs.release_commit }}
|
||||
CLONE_URL=${{ steps.prepare.outputs.clone_url }}
|
||||
RELEASE=${{ steps.prepare.outputs.release }}
|
||||
RELEASE=${{ needs.setup_release.outputs.publish_release }}
|
||||
tags: ${{ steps.prepare.outputs.tags }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
|
|
@ -367,15 +327,15 @@ jobs:
|
|||
with:
|
||||
context: ./
|
||||
file: ${{ matrix.dockerfile }}
|
||||
push: ${{ steps.prepare.outputs.push }}
|
||||
push: ${{ needs.setup_release.outputs.publish_release }}
|
||||
platforms: ${{ steps.prepare.outputs.platforms }}
|
||||
build-args: |
|
||||
BRANCH=${{ steps.prepare.outputs.branch }}
|
||||
BUILD_DATE=${{ steps.prepare.outputs.build_date }}
|
||||
BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }}
|
||||
COMMIT=${{ steps.prepare.outputs.commit }}
|
||||
BUILD_VERSION=${{ needs.setup_release.outputs.release_tag }}
|
||||
COMMIT=${{ needs.setup_release.outputs.release_commit }}
|
||||
CLONE_URL=${{ steps.prepare.outputs.clone_url }}
|
||||
RELEASE=${{ steps.prepare.outputs.release }}
|
||||
RELEASE=${{ needs.setup_release.outputs.publish_release }}
|
||||
tags: ${{ steps.prepare.outputs.tags }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
|
|
@ -401,22 +361,21 @@ jobs:
|
|||
path: artifacts/
|
||||
|
||||
- name: Create/Update GitHub Release
|
||||
if: ${{ needs.setup_release.outputs.create_release == 'true' && steps.prepare.outputs.artifacts == 'true' }}
|
||||
uses: ncipollo/release-action@v1
|
||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' && steps.prepare.outputs.artifacts == 'true' }}
|
||||
uses: LizardByte/create-release-action@v2024.520.211408
|
||||
with:
|
||||
name: ${{ needs.setup_release.outputs.release_name }}
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
commit: ${{ needs.setup_release.outputs.release_commit }}
|
||||
artifacts: "*artifacts/*"
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
allowUpdates: true
|
||||
body: ${{ needs.setup_release.outputs.release_body }}
|
||||
artifacts: "*artifacts/*"
|
||||
discussionCategory: announcements
|
||||
prerelease: ${{ needs.setup_release.outputs.pre_release }}
|
||||
generateReleaseNotes: true
|
||||
name: ${{ needs.setup_release.outputs.release_tag }}
|
||||
prerelease: true
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
- name: Update Docker Hub Description
|
||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||
uses: peter-evans/dockerhub-description@v3
|
||||
uses: peter-evans/dockerhub-description@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} # token is not currently supported
|
||||
|
|
|
|||
4
.github/workflows/localize.yml
vendored
4
.github/workflows/localize.yml
vendored
|
|
@ -3,7 +3,7 @@ name: localize
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: [nightly]
|
||||
branches: [master]
|
||||
paths: # prevents workflow from running unless these files change
|
||||
- '.github/workflows/localize.yml'
|
||||
- 'src/**'
|
||||
|
|
@ -85,7 +85,7 @@ jobs:
|
|||
commit-message: New localization template
|
||||
branch: localize/update
|
||||
delete-branch: true
|
||||
base: nightly
|
||||
base: master
|
||||
title: New Babel Updates
|
||||
body: |
|
||||
Update report
|
||||
|
|
|
|||
|
|
@ -3,10 +3,15 @@ name: Release Notifications (Moonlight)
|
|||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
types:
|
||||
- released # this triggers when a release is published, but does not include prereleases or drafts
|
||||
|
||||
jobs:
|
||||
discord:
|
||||
if: >-
|
||||
startsWith(github.repository, 'LizardByte/') &&
|
||||
!github.event.release.prerelease &&
|
||||
!github.event.release.draft
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: discord
|
||||
|
|
|
|||
71
.github/workflows/update-homebrew-release.yml
vendored
Normal file
71
.github/workflows/update-homebrew-release.yml
vendored
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
---
|
||||
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
|
||||
# If more Homebrew applications are developed, consider moving this action to the organization's .github repository,
|
||||
# using the `homebrew-pkg` repository label to identify repositories that should trigger have this workflow.
|
||||
|
||||
# Update Homebrew on release events.
|
||||
|
||||
name: Update Homebrew release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created, edited]
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-homebrew-release:
|
||||
if: >-
|
||||
github.repository_owner == 'LizardByte' &&
|
||||
!github.event.release.draft && !github.event.release.prerelease
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if Homebrew repo
|
||||
env:
|
||||
TOPIC: homebrew-pkg
|
||||
id: check
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const topic = process.env.TOPIC;
|
||||
console.log(`Checking if repo has topic: ${topic}`);
|
||||
|
||||
const repoTopics = await github.rest.repos.getAllTopics({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
console.log(`Repo topics: ${repoTopics.data.names}`);
|
||||
|
||||
const hasTopic = repoTopics.data.names.includes(topic);
|
||||
console.log(`Has topic: ${hasTopic}`);
|
||||
|
||||
core.setOutput('hasTopic', hasTopic);
|
||||
|
||||
- name: Download release asset
|
||||
id: download
|
||||
if: >-
|
||||
steps.check.outputs.hasTopic == 'true'
|
||||
uses: robinraju/release-downloader@v1.10
|
||||
with:
|
||||
repository: "${{ github.repository }}"
|
||||
tag: "${{ github.event.release.tag_name }}"
|
||||
fileName: "*.rb"
|
||||
tarBall: false
|
||||
zipBall: false
|
||||
out-file-path: "release_downloads"
|
||||
extract: false
|
||||
|
||||
- name: Publish Homebrew Formula
|
||||
if: >-
|
||||
steps.check.outputs.hasTopic == 'true' &&
|
||||
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||
uses: LizardByte/homebrew-release-action@v2024.522.222851
|
||||
with:
|
||||
formula_file: ${{ fromJson(steps.download.outputs.downloaded_files)[0] }}
|
||||
git_email: ${{ secrets.GH_BOT_EMAIL }}
|
||||
git_username: ${{ secrets.GH_BOT_NAME }}
|
||||
publish: true
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
validate: false
|
||||
4
.github/workflows/update-pages.yml
vendored
4
.github/workflows/update-pages.yml
vendored
|
|
@ -3,14 +3,14 @@ name: Build GH-Pages
|
|||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master, nightly]
|
||||
branches: [master]
|
||||
types: [opened, synchronize, reopened]
|
||||
push:
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
|
|
|||
69
.github/workflows/update-winget-release.yml
vendored
Normal file
69
.github/workflows/update-winget-release.yml
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
---
|
||||
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
|
||||
# If more Winget applications are developed, consider moving this action to the organization's .github repository,
|
||||
# using the `winget-pkg` repository label to identify repositories that should trigger have this workflow.
|
||||
|
||||
# Update Winget on release events.
|
||||
|
||||
name: Update Winget release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created, edited]
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-winget-release:
|
||||
if: >-
|
||||
github.repository_owner == 'LizardByte' &&
|
||||
!github.event.release.draft && !github.event.release.prerelease
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if Winget repo
|
||||
env:
|
||||
TOPIC: winget-pkg
|
||||
id: check
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const topic = process.env.TOPIC;
|
||||
console.log(`Checking if repo has topic: ${topic}`);
|
||||
|
||||
const repoTopics = await github.rest.repos.getAllTopics({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
console.log(`Repo topics: ${repoTopics.data.names}`);
|
||||
|
||||
const hasTopic = repoTopics.data.names.includes(topic);
|
||||
console.log(`Has topic: ${hasTopic}`);
|
||||
|
||||
core.setOutput('hasTopic', hasTopic);
|
||||
|
||||
- name: Download release asset
|
||||
id: download
|
||||
if: >-
|
||||
steps.check.outputs.hasTopic == 'true'
|
||||
uses: robinraju/release-downloader@v1.10
|
||||
with:
|
||||
repository: "${{ github.repository }}"
|
||||
tag: "${{ github.event.release.tag_name }}"
|
||||
fileName: "*.exe"
|
||||
tarBall: false
|
||||
zipBall: false
|
||||
out-file-path: "release_downloads"
|
||||
extract: false
|
||||
|
||||
- name: Release to WinGet
|
||||
if: >-
|
||||
steps.check.outputs.hasTopic == 'true' &&
|
||||
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||
uses: vedantmgoyal2009/winget-releaser@v2
|
||||
with:
|
||||
identifier: "${{ github.repository_owner }}.${{ github.event.repository.name }}"
|
||||
release-tag: ${{ github.event.release.tag_name }}
|
||||
installers-regex: '\.exe$'
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue