File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change 1
1
name : Publish to NPM
2
2
3
3
on :
4
- workflow_dispatch :
5
- inputs :
6
- version :
7
- description : " The version to release, e.g., 10.0.0-rc2"
8
- required : true
9
-
10
- defaults :
11
- run :
12
- working-directory : .
4
+ release :
5
+ types : [published]
13
6
14
7
jobs :
15
8
publish :
27
20
28
21
- name : Install Foundry
29
22
uses : foundry-rs/foundry-toolchain@v1
30
-
23
+
31
24
- name : Install Dependencies
32
25
run : |
33
26
yarn install
@@ -39,14 +32,17 @@ jobs:
39
32
- name : Determine NPM Tag
40
33
id : determine-npm-tag
41
34
run : |
42
- VERSION_TAG="${{ github.event.inputs.version }}"
35
+ VERSION_TAG=${GITHUB_REF#refs/tags/v}
43
36
if [[ $VERSION_TAG == *"-"* ]]; then
44
- echo "NPM_TAG= ${VERSION_TAG#*-}" >> $GITHUB_ENV
37
+ echo ::set-output name=NPM_TAG:: ${VERSION_TAG#*-}
45
38
else
46
- echo "NPM_TAG= latest" >> $GITHUB_ENV
39
+ echo ::set-output name=NPM_TAG:: latest
47
40
fi
41
+ env :
42
+ GITHUB_REF : ${{ github.ref }}
48
43
49
44
- name : Publish to NPM
50
- run : yarn publish --new-version ${{ github.event.inputs.version }} --tag ${{ env .NPM_TAG }} --no-git-tag-version
45
+ run : yarn publish --new-version ${GITHUB_REF#refs/tags/v} --tag ${{ steps.determine-npm-tag.outputs .NPM_TAG }} --no-git-tag-version
51
46
env :
52
47
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
48
+ GITHUB_REF : ${{ github.ref }}
You can’t perform that action at this time.
0 commit comments