Skip to content

Commit 67a2711

Browse files
chanceaclarkclaude
andauthored
ci: TRAC-881 Hook up Linear releases via linear-release-action (#3085)
Sync every push to canary/integrations-makeswift into Linear's "Catalyst Release" pipeline via linear/linear-release-action, so merged issues get attached to the currently open release as PRs land. Once changesets actually publishes a new @bigcommerce/catalyst-core or @bigcommerce/catalyst-makeswift version, complete that release using the GitHub Release notes changesets already generated for the tag. Refs TRAC-881 Co-authored-by: Claude <noreply@anthropic.com>
1 parent c6b3b07 commit 67a2711

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/changesets-release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
steps:
2222
- name: Checkout Repo
2323
uses: actions/checkout@v4
24+
with:
25+
# Full history required for linear-release-action to scan commits.
26+
fetch-depth: 0
2427

2528
- name: Setup pnpm
2629
uses: pnpm/action-setup@v3
@@ -39,6 +42,16 @@ jobs:
3942
env:
4043
CLI_SEGMENT_WRITE_KEY: ${{ secrets.CLI_SEGMENT_WRITE_KEY }}
4144

45+
- name: Sync Linear release
46+
uses: linear/linear-release-action@v0
47+
with:
48+
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
49+
command: sync
50+
# TODO: one-time bootstrap bound so the first sync doesn't scan this
51+
# existing project's full history. Remove once the pipeline has its
52+
# own release bookmark.
53+
base_ref: ${{ github.ref_name == 'canary' && '@bigcommerce/catalyst-core@1.8.0' || '@bigcommerce/catalyst-makeswift@1.8.0' }}
54+
4255
- name: Create Release Pull Request or Publish to npm
4356
id: changesets
4457
uses: changesets/action@v1
@@ -51,3 +64,34 @@ jobs:
5164
commit: "Version Packages (`${{ github.ref_name }}`)"
5265
env:
5366
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Resolve headline package
69+
id: headline
70+
if: steps.changesets.outputs.published == 'true'
71+
run: |
72+
PACKAGE_NAME="@bigcommerce/catalyst-core"
73+
if [ "${{ github.ref_name }}" = "integrations/makeswift" ]; then
74+
PACKAGE_NAME="@bigcommerce/catalyst-makeswift"
75+
fi
76+
VERSION=$(echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r --arg name "$PACKAGE_NAME" '.[] | select(.name == $name) | .version')
77+
if [ -z "$VERSION" ]; then
78+
echo "found=false" >> "$GITHUB_OUTPUT"
79+
else
80+
echo "found=true" >> "$GITHUB_OUTPUT"
81+
echo "tag=$PACKAGE_NAME@$VERSION" >> "$GITHUB_OUTPUT"
82+
fi
83+
84+
- name: Fetch release notes
85+
if: steps.headline.outputs.found == 'true'
86+
run: gh release view "${{ steps.headline.outputs.tag }}" --json body -q .body > /tmp/release-notes.md
87+
env:
88+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
90+
- name: Complete Linear release
91+
if: steps.headline.outputs.found == 'true'
92+
uses: linear/linear-release-action@v0
93+
with:
94+
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
95+
command: complete
96+
version: ${{ steps.headline.outputs.tag }}
97+
release_notes: /tmp/release-notes.md

0 commit comments

Comments
 (0)