Skip to content

Commit

Permalink
ci: swapping npx for yarn in publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
voodooGQ committed Mar 13, 2024
1 parent 7c18dda commit 4a967bb
Showing 1 changed file with 7 additions and 29 deletions.
36 changes: 7 additions & 29 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
lint-test-build:
uses: ./.github/workflows/lint-test-build.yml

setup:
publish:
needs: [lint-test-build]
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -54,37 +54,15 @@ jobs:
node-version: 18
registry-url: https://npm.pkg.github.com

- name: Determine git sha to checkout
uses: haya14busa/action-cond@v1
id: gitsha
with:
cond: ${{ github.event_name == 'pull_request' }}
if_true: ${{ github.event.pull_request.head.sha }}
if_false: ${{ github.sha }}

# Envs based on the current branch
- name: Branch Env
id: branch_env
run: |
echo "Running on branch "
if [ "${{ github.ref }}" == "refs/heads/develop" ]; then
echo "postfix=staging" >> $GITHUB_ENV
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
echo "postfix=production" >> $GITHUB_ENV
else
echo "postfix=staging" >> $GITHUB_ENV
fi
- name: Yarn Install
run: yarn install --frozen-lockfile

publish:
needs: [setup]
name: Publish Packages
runs-on: ubuntu-latest
if: needs.setup.outputs.postfix == 'production' # Only create package on `main`
steps:
- name: Lerna Boostrap
run: npx lerna bootstrap --ci
if: ${{ github.ref == "refs/heads/main" }} # Only create package on `main`
run: yarn lerna bootstrap --ci

- name: Lerna Publish
run: NODE_OPTIONS=--openssl-legacy-provider npx lerna publish --registry github --yes
if: ${{ github.ref == "refs/heads/main" }} # Only create package on `main`
run: NODE_OPTIONS=--openssl-legacy-provider yarn lerna publish --registry github --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}

0 comments on commit 4a967bb

Please sign in to comment.