|
21 | 21 | steps: |
22 | 22 | - name: Checkout Repo |
23 | 23 | uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + # Full history required for linear-release-action to scan commits. |
| 26 | + fetch-depth: 0 |
24 | 27 |
|
25 | 28 | - name: Setup pnpm |
26 | 29 | uses: pnpm/action-setup@v3 |
|
39 | 42 | env: |
40 | 43 | CLI_SEGMENT_WRITE_KEY: ${{ secrets.CLI_SEGMENT_WRITE_KEY }} |
41 | 44 |
|
| 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 | + |
42 | 55 | - name: Create Release Pull Request or Publish to npm |
43 | 56 | id: changesets |
44 | 57 | uses: changesets/action@v1 |
|
51 | 64 | commit: "Version Packages (`${{ github.ref_name }}`)" |
52 | 65 | env: |
53 | 66 | 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