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 11name : Publish to NPM
22
33on :
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]
136
147jobs :
158 publish :
2720
2821 - name : Install Foundry
2922 uses : foundry-rs/foundry-toolchain@v1
30-
23+
3124 - name : Install Dependencies
3225 run : |
3326 yarn install
@@ -39,14 +32,17 @@ jobs:
3932 - name : Determine NPM Tag
4033 id : determine-npm-tag
4134 run : |
42- VERSION_TAG="${{ github.event.inputs.version }}"
35+ VERSION_TAG=${GITHUB_REF#refs/tags/v}
4336 if [[ $VERSION_TAG == *"-"* ]]; then
44- echo "NPM_TAG= ${VERSION_TAG#*-}" >> $GITHUB_ENV
37+ echo ::set-output name=NPM_TAG:: ${VERSION_TAG#*-}
4538 else
46- echo "NPM_TAG= latest" >> $GITHUB_ENV
39+ echo ::set-output name=NPM_TAG:: latest
4740 fi
41+ env :
42+ GITHUB_REF : ${{ github.ref }}
4843
4944 - 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
5146 env :
5247 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
48+ GITHUB_REF : ${{ github.ref }}
You can’t perform that action at this time.
0 commit comments