Skip to content

Commit

Permalink
feat(.github): tune release publish flow
Browse files Browse the repository at this point in the history
  • Loading branch information
narekhovhannisyan committed Jun 12, 2024
1 parent 69d13a8 commit e4f9972
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,12 @@ on:
- release

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
- run: npm test

publish-npm:
needs: build
release-publish-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main


- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -33,6 +20,12 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Run unit tests
run: npm test

- name: Install dependencies
run: npm ci

- name: Initialize git user email
run: git config --global user.email "${{ env.RELEASE_USER_EMAIL }}"

Expand Down Expand Up @@ -60,6 +53,11 @@ jobs:
echo "LATEST_RELEASE_NAME=$LATEST_RELEASE_NAME" >> $GITHUB_ENV
echo "IS_PRE_RELEASE=$IS_PRE_RELEASE" >> $GITHUB_ENV
- name: Fetch and checkout to release branch
run: |
git fetch --all
git checkout ${{ vars.RELEASE_BRANCH_NAME }}
- name: Publish to npm (pre-release)
if: env.IS_PRE_RELEASE == 'true'
run: npm publish --tag beta
Expand Down

0 comments on commit e4f9972

Please sign in to comment.