diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 09d3461256..8f17418a56 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: @@ -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 }}