diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a79df76..2fb394b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,5 @@ +name: Release + on: push: branches: [master] @@ -26,7 +28,7 @@ jobs: id: release_output if: ${{ steps.prepare_tag.outcome == 'success' }} run: | - echo "::set-output name=tag::${{ env.TAG }}" + echo "tag=${{ env.TAG }}" >> $GITHUB_OUTPUT outputs: tag: ${{ steps.release_output.outputs.tag }} @@ -34,6 +36,8 @@ jobs: runs-on: ubuntu-latest needs: check-release-tag if: ${{ needs.check-release-tag.outputs.tag }} + permissions: + contents: write steps: - uses: actions/checkout@v4 - name: Prepare tag @@ -49,15 +53,15 @@ jobs: csplit -s CHANGELOG.md "/##/" {1} cat xx01 > CHANGELOG.tmp - name: Create Release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2 with: tag_name: ${{ env.TAG }} - release_name: ${{ env.TAG }} + name: ${{ env.TAG }} body_path: CHANGELOG.tmp draft: false prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish-to-npm: runs-on: ubuntu-latest @@ -66,7 +70,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: "14" + node-version: "20" + registry-url: "https://registry.npmjs.org" - run: npm install - run: npm publish --access public env: