Skip to content

Commit d8fe268

Browse files
chanceaclarkclaude
andcommitted
ci: TRAC-881 Hook up Linear releases via linear-release-action
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 d8fe268

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/changesets-release.yml

Lines changed: 40 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,12 @@ 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+
4251
- name: Create Release Pull Request or Publish to npm
4352
id: changesets
4453
uses: changesets/action@v1
@@ -51,3 +60,34 @@ jobs:
5160
commit: "Version Packages (`${{ github.ref_name }}`)"
5261
env:
5362
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
64+
- name: Resolve headline package
65+
id: headline
66+
if: steps.changesets.outputs.published == 'true'
67+
run: |
68+
PACKAGE_NAME="@bigcommerce/catalyst-core"
69+
if [ "${{ github.ref_name }}" = "integrations/makeswift" ]; then
70+
PACKAGE_NAME="@bigcommerce/catalyst-makeswift"
71+
fi
72+
VERSION=$(echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r --arg name "$PACKAGE_NAME" '.[] | select(.name == $name) | .version')
73+
if [ -z "$VERSION" ]; then
74+
echo "found=false" >> "$GITHUB_OUTPUT"
75+
else
76+
echo "found=true" >> "$GITHUB_OUTPUT"
77+
echo "tag=$PACKAGE_NAME@$VERSION" >> "$GITHUB_OUTPUT"
78+
fi
79+
80+
- name: Fetch release notes
81+
if: steps.headline.outputs.found == 'true'
82+
run: gh release view "${{ steps.headline.outputs.tag }}" --json body -q .body > /tmp/release-notes.md
83+
env:
84+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
86+
- name: Complete Linear release
87+
if: steps.headline.outputs.found == 'true'
88+
uses: linear/linear-release-action@v0
89+
with:
90+
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
91+
command: complete
92+
version: ${{ steps.headline.outputs.tag }}
93+
release_notes: /tmp/release-notes.md

0 commit comments

Comments
 (0)