diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 45824b0..f6c26cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,40 +1,17 @@ -name: Create Tag and Release +# 根据 tag 自动创建发行版 +name: Create Release +# name: Main on: push: - branches: - - master + tags: + - "v*.*.*" jobs: build: runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 14 - - - name: Install dependencies - run: npm ci - - - name: Get version - id: package - run: echo "::set-output name=version::$(node -p "require('./package.json').version")" - - - name: Create Tag - run: git tag ${{ steps.package.outputs.version }} - - - name: Push Tag - run: git push origin ${{ steps.package.outputs.version }} - - - name: Create Release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.package.outputs.version }} - release_name: Release ${{ steps.package.outputs.version }} + - name: Checkout + uses: actions/checkout@v4 + - name: Release + uses: softprops/action-gh-release@v2