Skip to content

Commit b22ca85

Browse files
committed
Github Actions: Modernize the release workflow
1 parent c312308 commit b22ca85

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Release
2+
13
on:
24
push:
35
branches: [master]
@@ -26,14 +28,16 @@ jobs:
2628
id: release_output
2729
if: ${{ steps.prepare_tag.outcome == 'success' }}
2830
run: |
29-
echo "::set-output name=tag::${{ env.TAG }}"
31+
echo "tag=${{ env.TAG }}" >> $GITHUB_OUTPUT
3032
outputs:
3133
tag: ${{ steps.release_output.outputs.tag }}
3234

3335
create-github-release:
3436
runs-on: ubuntu-latest
3537
needs: check-release-tag
3638
if: ${{ needs.check-release-tag.outputs.tag }}
39+
permissions:
40+
contents: write
3741
steps:
3842
- uses: actions/checkout@v4
3943
- name: Prepare tag
@@ -49,15 +53,15 @@ jobs:
4953
csplit -s CHANGELOG.md "/##/" {1}
5054
cat xx01 > CHANGELOG.tmp
5155
- name: Create Release
52-
uses: actions/create-release@v1
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
uses: softprops/action-gh-release@v2
5557
with:
5658
tag_name: ${{ env.TAG }}
57-
release_name: ${{ env.TAG }}
59+
name: ${{ env.TAG }}
5860
body_path: CHANGELOG.tmp
5961
draft: false
6062
prerelease: false
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6165

6266
publish-to-npm:
6367
runs-on: ubuntu-latest
@@ -66,7 +70,8 @@ jobs:
6670
- uses: actions/checkout@v4
6771
- uses: actions/setup-node@v4
6872
with:
69-
node-version: "14"
73+
node-version: "20"
74+
registry-url: "https://registry.npmjs.org"
7075
- run: npm install
7176
- run: npm publish --access public
7277
env:

0 commit comments

Comments
 (0)