Skip to content

Commit c382ea5

Browse files
authored
[NO JIRA]: Update CI for dev and stable releases (#186)
1 parent 15ac238 commit c382ea5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: main-release
33
on:
44
push:
55
branches: [main]
6+
release:
7+
types: [ published ]
68

79
defaults:
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 }}

0 commit comments

Comments
 (0)