From c5227ebecb6feefe501599b63812b9b752247c9b Mon Sep 17 00:00:00 2001 From: vclass <> Date: Thu, 5 Sep 2024 21:28:09 +0800 Subject: [PATCH] modify github action --- .github/workflows/release.yaml | 37 +++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4d5c729..8219b5b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,7 +6,30 @@ on: - "*" jobs: + create-release: + runs-on: ubuntu-latest + outputs: + RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }} + + steps: + - uses: actions/checkout@v4 + - name: Get version + id: get_release_version + shell: bash + run: | + echo "using version tag ${GITHUB_REF:10}" + echo "VERSION=${GITHUB_REF:10}" >> $GITHUB_OUTPUT + - name: Release + id: create_release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + body: "See the assets to download this version and install." + name: "MaaBo v${{ steps.get_release_version.outputs.VERSION }}" + tag_name: "${{ steps.get_release_version.outputs.VERSION }}" + publish-tauri: + needs: create-release permissions: contents: write strategy: @@ -25,15 +48,18 @@ jobs: - uses: actions/checkout@v4 - name: Get version - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + id: get_build_version + shell: bash + run: | + echo "using version tag ${GITHUB_REF:10}" + echo "VERSION=${GITHUB_REF:10}" >> $GITHUB_OUTPUT - name: Set app version uses: MathieuSoysal/replace-string-in-file@v1.1.0 with: file: src-tauri/Cargo.toml old-string: version = "0.0.0" - new-string: version = "${{ steps.get_version.outputs.VERSION }}" + new-string: version = "${{ steps.get_build_version.outputs.VERSION }}" - name: setup node uses: actions/setup-node@v4 @@ -61,6 +87,7 @@ jobs: tagName: app-v__VERSION__ releaseName: "MaaBo v__VERSION__" releaseBody: "See the assets to download this version and install." - releaseDraft: true + releaseDraft: false prerelease: false - args: ${{ matrix.args }} \ No newline at end of file + args: ${{ matrix.args }} + releaseId: ${{ needs.create-release.outputs.id }} \ No newline at end of file