diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c926455..a168e79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,8 @@ jobs: build: runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - name: Check out git repository + uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 @@ -21,10 +22,6 @@ jobs: with: python-version: 3.11.9 - # Push tag to GitHub if package.json version's tag is not tagged - - name: Get package version - run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV - - name: Install dependencies run: | python -m pip install --upgrade pip @@ -47,6 +44,18 @@ jobs: windows-file-description: 一个Steam仓库清单下载器 output-file: Onekey---v${{ env.PACKAGE_VERSION }}.exe + - name: Get package version + run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV + + - name: Create git tag + uses: pkgdeps/git-tag-action@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + github_repo: ${{ github.repository }} + version: ${{ env.PACKAGE_VERSION }} + git_commit_sha: ${{ github.sha }} + git_tag_prefix: "v" + - name: Release uses: softprops/action-gh-release@v2 with: