Skip to content

init-prerelease

init-prerelease #370

name: init-prerelease
on:
workflow_dispatch:
branch:
- release/v17
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 'release/v17' \
--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
needs:
- check-exist-pr
steps:
- uses: actions/checkout@v4.1.1
with:
token: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }}
fetch-depth: 0
persist-credentials: false
- uses: pnpm/action-setup@v4.0.0
name: Install pnpm
id: pnpm-install
with:
version: 10.11.1
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
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@72b6676b71ab476b77e676928516f6982eef7a41
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
env:
GITHUB_SECRET: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }}
run: |
git config user.name "semrush-ci-whale"
git config user.email "semrush-ci-whale@users.noreply.github.com"
git remote set-url origin "https://${GITHUB_SECRET}@github.com/semrush/intergalactic.git"
pnpm init-prerelease