Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,26 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SHOPIFY_CLI_BUILD_REPO: ${{ github.repository }}

- name: Create git tag and GitHub Release
if: steps.changesets.outputs.hasChangesets == 'false' && startsWith(github.ref_name, 'stable/')
run: |
VERSION=$(node -p "require('./packages/cli-kit/package.json').version")
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "v${VERSION}"
git push origin "v${VERSION}"
gh release create "v${VERSION}" \
--title "${VERSION}" \
--notes "See the [CHANGELOG](https://github.com/Shopify/cli/blob/${{ github.ref_name }}/packages/cli/CHANGELOG.md) for details."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Open post-release PRs
if: steps.changesets.outputs.hasChangesets == 'false' && startsWith(github.ref_name, 'stable/')
run: pnpm post-release --skip-notification
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Manual/Cron release job - runs on schedule or manual trigger with tag
manual-cron-release:
name: Manual & Cron Release
Expand Down
39 changes: 25 additions & 14 deletions bin/post-release
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#! /usr/bin/env bash

tag=$1
# Parse flags
skip_notification=false
for arg in "$@"; do
case $arg in
--skip-notification) skip_notification=true ;;
esac
done

# Check if current branch starts with "stable"
current_branch=$(git branch --show-current)
Expand All @@ -9,18 +15,20 @@ if [[ ! $current_branch =~ ^stable ]]; then
exit 1
fi

# Check if git working directory is clean
if [[ -n $(git status -s) ]]; then
echo "Error: Git working directory is not clean"
git status
exit 1
fi

# Check if github print-auth is working
if ! $(/opt/dev/bin/dev github print-auth --password > /dev/null 2>&1); then
echo "Error: GitHub CLI authentication failed"
echo "Try running \`dev github print-auth\` manually"
exit 1
if [[ -z "$CI" ]]; then
# Check if git working directory is clean
if [[ -n $(git status -s) ]]; then
echo "Error: Git working directory is not clean"
git status
exit 1
fi

# Check if github print-auth is working
if ! $(/opt/dev/bin/dev github print-auth --password > /dev/null 2>&1); then
echo "Error: GitHub CLI authentication failed"
echo "Try running \`dev github print-auth\` manually"
exit 1
fi
fi

# Create a PR to update homebrew
Expand All @@ -30,5 +38,8 @@ node ./bin/create-homebrew-pr.js
node ./bin/create-doc-pr.js

# Create a PR to add the release notification
node ./bin/create-notification-pr.js
# Skipped for patch releases (--skip-notification) — notifications are not sent for patches
if [[ "$skip_notification" == "false" ]]; then
node ./bin/create-notification-pr.js
fi

Loading