From 8d986c8a7708aefcc80a75efdfb9835af27633a1 Mon Sep 17 00:00:00 2001 From: adakite1 Date: Fri, 7 Mar 2025 06:43:57 +0800 Subject: [PATCH] Automatically create new pre-release on tag push with artifacts as downloads. --- .github/workflows/build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72792a4b..39aa828f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,8 @@ name: CMake on: push: + tags: + - '*' branches: [ master ] pull_request: branches: [ master ] @@ -57,9 +59,27 @@ jobs: VERSION=$(git -C '${{github.workspace}}' describe --first-parent) PLATFORM=$(echo ${{matrix.config.name}} | tr '[:upper:]' '[:lower:'] | sed 's/ /_/g') echo "FILENAME=armips_${VERSION}_${PLATFORM}" >> $GITHUB_ENV + echo "RELEASENAME=armips_${VERSION}" >> $GITHUB_ENV - name: Upload uses: actions/upload-artifact@v4 with: name: ${{env.FILENAME}} path: ${{github.workspace}}/install + + - name: Archive Release + uses: thedoctor0/zip-release@0.7.6 + if: startsWith(github.ref, 'refs/tags/') + with: + type: 'zip' + filename: ${{env.FILENAME}}.zip + directory: '${{github.workspace}}/install' + + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + name: ${{env.RELEASENAME}} + prerelease: true + files: ${{github.workspace}}/install/${{env.FILENAME}}.zip + \ No newline at end of file