Skip to content

Commit

Permalink
[NO JIRA]: Update CI for dev and stable releases (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
olliecurtis authored Apr 4, 2024
1 parent 15ac238 commit c382ea5
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: main-release
on:
push:
branches: [main]
release:
types: [ published ]

defaults:
run:
Expand Down Expand Up @@ -35,12 +37,23 @@ jobs:
- name: Build
run: npm run build

- name: Publish NPM package

- name: Publish dev NPM package
if: ${{ github.event_name != 'release' && github.ref_name != github.event.repository.default_branch }}
run: |
cd packages/react-scripts
npm version prerelease --preid=$BUILD_VERSION-dev --no-git-tag-version
npm publish --tag alpha
env:
BUILD_VERSION: ${{ github.run_number }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish release NPM package
if: ${{ github.event_name == 'release' }}
run: |
cd packages/react-scripts
npm version $RELEASE_VERSION --no-git-tag-version
npm publish
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit c382ea5

Please sign in to comment.