publish-unlocked-release #274
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: publish-unlocked-release | |
| on: | |
| push: | |
| tags: | |
| - v[0-9]+.[0-9]+.[0-9]+ | |
| workflow_dispatch: | |
| tags: | |
| - v[0-9]+.[0-9]+.[0-9]+ | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| token: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }} | |
| - name: Install Node.js | |
| uses: actions/[email protected] | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/[email protected] | |
| name: Install pnpm | |
| id: pnpm-install | |
| with: | |
| version: 8.7.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/[email protected] | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| - name: Cache build | |
| uses: actions/[email protected] | |
| id: cache-build | |
| with: | |
| path: | | |
| semcore/*/lib | |
| tools/*/lib | |
| semcore/icon/**/*.js | |
| semcore/icon/**/*.mjs | |
| semcore/icon/**/*.d.ts | |
| semcore/illustration/**/*.js | |
| semcore/illustration/**/*.mjs | |
| semcore/illustration/**/*.d.ts | |
| key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5 | |
| - name: Install dependencies | |
| run: | | |
| pnpm install --frozen-lockfile | |
| - name: Build | |
| if: steps.cache-build.outputs.cache-hit != 'true' | |
| run: | | |
| pnpm build | |
| publish-unlocked-release: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| env: | |
| GITHUB_SECRET: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }} | |
| GCLOUD_SECRET: ${{ secrets.GCLOUD_SECRET }} | |
| SLACK_API_ENDPOINTS: ${{ secrets.SLACK_WEBHOOK_URLS }} | |
| INTERGALACTIC_BOT_CLOSE_TASKS_URL: ${{ secrets.INTERGALACTIC_BOT_CLOSE_TASKS_URL }} | |
| INTERGALACTIC_BOT_SECRET: ${{ secrets.INTERGALACTIC_BOT_SECRET }} | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| token: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - uses: pnpm/[email protected] | |
| name: Install pnpm | |
| id: pnpm-install | |
| with: | |
| version: 8.7.6 | |
| run_install: false | |
| - uses: actions/[email protected] | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/[email protected] | |
| name: Restore pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| - name: Restore cached build | |
| uses: actions/[email protected] | |
| with: | |
| path: | | |
| semcore/*/lib | |
| tools/*/lib | |
| semcore/icon/**/*.js | |
| semcore/icon/**/*.mjs | |
| semcore/icon/**/*.d.ts | |
| semcore/illustration/**/*.js | |
| semcore/illustration/**/*.mjs | |
| semcore/illustration/**/*.d.ts | |
| key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5 | |
| - name: Install restored dependencies | |
| run: | | |
| pnpm install | |
| - name: Github GPG Auth | |
| uses: crazy-max/[email protected] | |
| with: | |
| gpg_private_key: ${{ secrets.BOT_ACCOUNT_GPG_PRIVATE_KEY }} | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| git_committer_name: semrush-ci-whale | |
| git_committer_email: [email protected] | |
| - name: NPM setup | |
| run: | | |
| echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ".npmrc" | |
| echo "strict-peer-dependencies=false" >> ".npmrc" | |
| - name: NPM auth check | |
| run: pnpm whoami | |
| - name: Publish release | |
| run: pnpm --filter intergalactic-migrate run build && pnpm publish-release | |
| publish-website: | |
| runs-on: ubuntu-latest | |
| needs: publish-unlocked-release | |
| env: | |
| GITHUB_SECRET: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }} | |
| GCLOUD_SECRET: ${{ secrets.GCLOUD_SECRET }} | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| token: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }} | |
| - uses: pnpm/[email protected] | |
| name: Install pnpm | |
| id: pnpm-install | |
| with: | |
| version: 8.7.6 | |
| run_install: false | |
| - uses: actions/[email protected] | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - name: Github GPG Auth | |
| uses: crazy-max/[email protected] | |
| with: | |
| gpg_private_key: ${{ secrets.BOT_ACCOUNT_GPG_PRIVATE_KEY }} | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| git_committer_name: semrush-ci-whale | |
| git_committer_email: [email protected] | |
| - name: Update website/release branch | |
| run: | | |
| git checkout -b website/release | |
| git push --force --set-upstream origin website/release | |
| git push origin website/release --force | |
| create-pr: | |
| runs-on: ubuntu-latest | |
| needs: publish-unlocked-release | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| token: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }} | |
| - name: create pull request | |
| run: | | |
| git checkout -b release/$GITHUB_REF_NAME | |
| git push --set-upstream origin release/$GITHUB_REF_NAME | |
| gh pr create -B master -H release/$GITHUB_REF_NAME --title 'Merge release tag into master' --body 'Created by Github action' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }} |