@@ -17,37 +17,28 @@ jobs:
17
17
registry-url : https://registry.npmjs.org/
18
18
19
19
- run : |
20
- VERSION=${GITHUB_REF/refs\/tags\//}
21
- TAG='latest'
22
- if [[ $VERSION =~ 'alpha' || $VERSION =~ 'beta' || $VERSION =~ 'rc' ]]; then
23
- TAG='next'
24
- fi
25
- npm publish --tag $TAG
26
- env:
27
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
20
+ NPM_TAG='latest'
21
+ IS_PRERELEASE=false
28
22
29
- # @see https://github.com/actions/create-release/issues/38#issuecomment-715327220
30
- # @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files
31
- - name : Prepare the changelog from the tag message
32
- id : prepare_changelog
33
- run : |
34
- PRERELEASE=false
35
- # Check release type
36
23
if [[ $GITHUB_REF_NAME =~ 'alpha' || $GITHUB_REF_NAME =~ 'beta' || $GITHUB_REF_NAME =~ 'rc' ]]; then
37
- echo "This is a prerelease."
38
- PRERELEASE =true
24
+ NPM_TAG='next'
25
+ IS_PRERELEASE =true
39
26
fi
40
- echo "is_prerelease=$PRERELEASE" >> $GITHUB_ENV
41
27
42
- # @see https://github.com/actions/create-release
43
- - name : Create Release
44
- id : create_release
45
- uses : actions/create-release@v1
46
- env :
47
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
28
+ echo "NPM_TAG=$NPM_TAG" >> $GITHUB_ENV
29
+ echo "IS_PRERELEASE=$IS_PRERELEASE" >> $GITHUB_ENV
30
+
31
+ - uses : JS-DevTools/npm-publish@v3
32
+ with :
33
+ provenance : true
34
+ package : .
35
+ tag : ${{ env.NPM_TAG }}
36
+ token : ${{ secrets.NPM_TOKEN }}
37
+
38
+ - uses : ncipollo/release-action@v1
48
39
with :
49
- tag_name : ${{ github.ref }}
50
- release_name : v${{ github.ref_name }}
51
- body : Please refer to [CHANGELOG.md](https://github.com/studiometa/prettier-formatter-gitlab /blob/${{ github.ref_name }}/CHANGELOG.md) for details.
40
+ tag : ${{ github.ref }}
41
+ name : v${{ github.ref_name }}
42
+ body : Please refer to [CHANGELOG.md](https://github.com/${{ github.repository }} /blob/${{ github.ref_name }}/CHANGELOG.md) for details.
52
43
draft : false
53
- prerelease : ${{ env.is_prerelease }}
44
+ prerelease : ${{ env.IS_PRERELEASE }}
0 commit comments