File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ name: main-release
33on :
44 push :
55 branches : [main]
6+ release :
7+ types : [ published ]
68
79defaults :
810 run :
@@ -35,12 +37,23 @@ jobs:
3537
3638 - name : Build
3739 run : npm run build
38-
39- - name : Publish NPM package
40+
41+ - name : Publish dev NPM package
42+ if : ${{ github.event_name != 'release' && github.ref_name != github.event.repository.default_branch }}
4043 run : |
4144 cd packages/react-scripts
4245 npm version prerelease --preid=$BUILD_VERSION-dev --no-git-tag-version
4346 npm publish --tag alpha
4447 env :
4548 BUILD_VERSION : ${{ github.run_number }}
4649 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
50+
51+ - name : Publish release NPM package
52+ if : ${{ github.event_name == 'release' }}
53+ run : |
54+ cd packages/react-scripts
55+ npm version $RELEASE_VERSION --no-git-tag-version
56+ npm publish
57+ env :
58+ RELEASE_VERSION : ${{ github.event.release.tag_name }}
59+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments