init-prerelease #138
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/[email protected] | |
- 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/[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: 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: Init prerelease | |
run: | | |
pnpm --filter intergalactic-migrate run build | |
pnpm init-prerelease |