init-prerelease #113
This file contains 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: init-prerelease | |
on: | |
workflow_dispatch: | |
branch: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
check-exist-pr: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- name: check-not-merged-pr | |
run: | | |
prs=$(gh pr list \ | |
--base 'master' \ | |
--json title \ | |
-A semrush-ci-whale \ | |
-S 'Merge release tag into master' \ | |
--jq 'length') | |
if ((prs > 0)); then | |
echo "Merge exist PR with last release to the master first" | |
exit 1 | |
fi | |
init-prerelease: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_SECRET: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }} | |
GCLOUD_SECRET: ${{ secrets.GCLOUD_SECRET }} | |
needs: | |
- check-exist-pr | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
with: | |
token: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }} | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4.0.0 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.7.6 | |
run_install: false | |
- uses: actions/setup-node@v4.0.1 | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4.0.0 | |
name: Restore pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Install restored dependencies | |
run: | | |
pnpm install | |
- name: Github GPG Auth | |
uses: crazy-max/ghaction-import-gpg@v5.3.0 | |
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: semrush-ci-whale@users.noreply.github.com | |
- 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: Init prerelease | |
run: | | |
pnpm --filter intergalactic-migrate run build | |
pnpm init-prerelease |