Start release #5
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: Start release | |
on: | |
workflow_dispatch: # manual trigger | |
jobs: | |
create-release-branch: | |
name: Create release branch | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # needed to push the new branch | |
pull-requests: write # needed to create version PR | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
fetch-depth: 0 # full history lets status work out the diff | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: pnpm | |
- run: pnpm install | |
- name: Compute next version | |
id: next | |
run: | | |
npx changeset status --output status.json | |
VERSION=$(jq -r '.releases[] | | |
select(.name=="@reown/appkit") | | |
.newVersion' status.json) | |
if [[ -z "$VERSION" || "$VERSION" == "null" ]]; then | |
echo "No unreleased changesets for @reown/appkit – aborting." | |
exit 1 | |
fi | |
echo "next_version=$VERSION" >> "$GITHUB_OUTPUT" | |
- name: Create release branch | |
run: | | |
BRANCH="release/${{ steps.next.outputs.next_version }}" | |
# stop if the branch name already exists on origin | |
if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null; then | |
echo "🔴 Branch $BRANCH already exists on remote – aborting." | |
exit 1 | |
fi | |
git switch -c "$BRANCH" | |
git push --set-upstream origin "$BRANCH" | |
echo "✅ Created and pushed $BRANCH" | |
- name: Open "version packages" PR | |
uses: changesets/action@v1 | |
with: | |
branch: release/${{ steps.next.outputs.next_version }} | |
title: 'chore: version packages' | |
commit: 'chore: version packages' | |
version: pnpm changeset:version | |
# publish is **omitted** – we only want the PR now | |
createGithubReleases: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Start Slack Notify Workflow | |
# uses: slackapi/[email protected] | |
# with: | |
# webhook: ${{ secrets.SLACK_WEBHOOK_URL_RELEASE_NOTIFY }} | |
# webhook-type: webhook-trigger | |
# payload: | | |
# version: "${{ steps.next.outputs.next_version }}" |