Commit 33afecd 1 parent f054de1 commit 33afecd Copy full SHA for 33afecd
File tree 1 file changed +35
-5
lines changed
1 file changed +35
-5
lines changed Original file line number Diff line number Diff line change 6
6
- ' *.*.*'
7
7
8
8
jobs :
9
- publish :
10
- runs-on : ubuntu -latest
9
+ release :
10
+ runs-on : macos -latest
11
11
steps :
12
12
- uses : actions/checkout@v4
13
- - uses : JS-DevTools/npm-publish@v3
13
+ - uses : actions/setup-node@v4
14
14
with :
15
- token : ${{ secrets.NPM_TOKEN }}
16
- - uses : actions/create-release@v1
15
+ node-version : 20
16
+ cache : npm
17
+ registry-url : https://registry.npmjs.org/
18
+
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}}
28
+
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
+ if [[ $GITHUB_REF_NAME =~ 'alpha' || $GITHUB_REF_NAME =~ 'beta' || $GITHUB_REF_NAME =~ 'rc' ]]; then
37
+ echo "This is a prerelease."
38
+ PRERELEASE=true
39
+ fi
40
+ echo "is_prerelease=$PRERELEASE" >> $GITHUB_ENV
41
+
42
+ # @see https://github.com/actions/create-release
43
+ - name : Create Release
44
+ id : create_release
45
+ uses : actions/create-release@v1
17
46
env :
18
47
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
19
48
with :
20
49
tag_name : ${{ github.ref }}
21
50
release_name : v${{ github.ref_name }}
22
51
body : Please refer to [CHANGELOG.md](https://github.com/studiometa/prettier-formatter-gitlab/blob/${{ github.ref_name }}/CHANGELOG.md) for details.
23
52
draft : false
53
+ prerelease : ${{ env.is_prerelease }}
You can’t perform that action at this time.
0 commit comments