From 596706fea91198b53613b855a8b995527c33c44c Mon Sep 17 00:00:00 2001 From: otavepto <153766569+otavepto@users.noreply.github.com> Date: Fri, 31 May 2024 15:34:28 +0300 Subject: [PATCH] fix release workflow + allow manual trigger for testing --- .github/workflows/emu-build-all-linux.yml | 4 +- .github/workflows/emu-build-all-win.yml | 4 +- .github/workflows/release.yml | 78 +++++++++++++++++++++-- 3 files changed, 77 insertions(+), 9 deletions(-) diff --git a/.github/workflows/emu-build-all-linux.yml b/.github/workflows/emu-build-all-linux.yml index 686cd034..d69880ed 100644 --- a/.github/workflows/emu-build-all-linux.yml +++ b/.github/workflows/emu-build-all-linux.yml @@ -110,8 +110,8 @@ jobs: echo "actual run..." make -j 2 config=${{ matrix.cfg }}_${{ matrix.arch }} ${{ matrix.prj }} -### upload artifact/package to github Actions (for targets) - - name: Upload build package (for targets) +### upload artifact/package to github Actions + - name: Upload target package uses: actions/upload-artifact@v4 with: name: "emu-linux-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}" diff --git a/.github/workflows/emu-build-all-win.yml b/.github/workflows/emu-build-all-win.yml index 4a0f898a..9d9702a6 100644 --- a/.github/workflows/emu-build-all-win.yml +++ b/.github/workflows/emu-build-all-win.yml @@ -99,8 +99,8 @@ jobs: run: | msbuild /nologo /target:${{ matrix.prj }} /m:2 /v:n /p:Configuration=${{ matrix.cfg }},Platform=${{ matrix.arch }} gbe.sln -### upload artifact/package to github Actions (for targets) - - name: Upload build package (for targets) +### upload artifact/package to github Actions + - name: Upload target package uses: actions/upload-artifact@v4 with: name: "emu-win-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e9faf31..400f845b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,9 @@ name: Prepare release on: push: tags: - - release* + - release-* + workflow_dispatch: + # allows manual trigger permissions: contents: write @@ -52,13 +54,13 @@ jobs: - name: Package build (release) shell: cmd working-directory: ${{ github.workspace }} - run: package_win.bat release + run: package_win.bat vs2022\release ### package (debug mode) - name: Package build (debug) shell: cmd working-directory: ${{ github.workspace }} - run: package_win.bat debug + run: package_win.bat vs2022\debug ### release (debug + release modes) if this is a tag push - name: Release @@ -67,6 +69,17 @@ jobs: with: files: "build/package/win/**/*" +### upload artifact/package if this is a manual run + - name: Upload release package + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/upload-artifact@v4 + with: + name: "release-emu-win-${{ github.sha }}" + path: "build/package/win/**/*" + if-no-files-found: 'error' + compression-level: 9 + retention-days: 1 + emu-linux-all: @@ -107,13 +120,13 @@ jobs: - name: Package build (release) shell: bash working-directory: ${{ github.workspace }} - run: sudo ./package_linux.sh release + run: sudo ./package_linux.sh gmake2/release ### package (debug mode) - name: Package build (debug) shell: bash working-directory: ${{ github.workspace }} - run: sudo ./package_linux.sh debug + run: sudo ./package_linux.sh gmake2/debug ### release (debug + release modes) if this is a tag push - name: Release @@ -122,6 +135,17 @@ jobs: with: files: "build/package/linux/**/*" +### upload artifact/package if this is a manual run + - name: Upload release package + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/upload-artifact@v4 + with: + name: "release-emu-linux-${{ github.sha }}" + path: "build/package/linux/**/*" + if-no-files-found: 'error' + compression-level: 9 + retention-days: 1 + gen_emu_script-win: @@ -173,6 +197,17 @@ jobs: with: files: "tools/generate_emu_config/bin/package/win/**/*" +### upload artifact/package if this is a manual run + - name: Upload release package + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/upload-artifact@v4 + with: + name: "release-generate_emu_config-win-${{ github.sha }}" + path: "tools/generate_emu_config/bin/package/win/**/*" + if-no-files-found: 'error' + compression-level: 9 + retention-days: 1 + gen_emu_script-linux: @@ -216,6 +251,17 @@ jobs: with: files: "tools/generate_emu_config/bin/package/linux/**/*" +### upload artifact/package if this is a manual run + - name: Upload release package + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/upload-artifact@v4 + with: + name: "release-generate_emu_config-linux-${{ github.sha }}" + path: "tools/generate_emu_config/bin/package/linux/**/*" + if-no-files-found: 'error' + compression-level: 9 + retention-days: 1 + migrate_gse_script-win: @@ -267,6 +313,17 @@ jobs: with: files: "tools/migrate_gse/bin/package/win/**/*" +### upload artifact/package if this is a manual run + - name: Upload release package + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/upload-artifact@v4 + with: + name: "release-migrate_gse-win-${{ github.sha }}" + path: "tools/migrate_gse/bin/package/win/**/*" + if-no-files-found: 'error' + compression-level: 9 + retention-days: 1 + migrate_gse_script-linux: @@ -310,5 +367,16 @@ jobs: with: files: "tools/migrate_gse/bin/package/linux/**/*" +### upload artifact/package if this is a manual run + - name: Upload release package + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/upload-artifact@v4 + with: + name: "release-migrate_gse-linux-${{ github.sha }}" + path: "tools/migrate_gse/bin/package/linux/**/*" + if-no-files-found: 'error' + compression-level: 9 + retention-days: 1 +