feat(cli): rename BIGCOMMERCE_API_HOST → CATALYST_API_HOST and resolv… #1295
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: Changesets Release | |
| on: | |
| push: | |
| branches: | |
| - canary | |
| - integrations/makeswift | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| permissions: | |
| id-token: write | |
| contents: write | |
| packages: write | |
| pull-requests: write | |
| jobs: | |
| changesets-release: | |
| name: Changesets Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| # Full history required for linear-release-action to scan commits. | |
| fetch-depth: 0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "pnpm" | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Packages | |
| run: pnpm --filter "./packages/**" build | |
| env: | |
| CLI_SEGMENT_WRITE_KEY: ${{ secrets.CLI_SEGMENT_WRITE_KEY }} | |
| - name: Sync Linear release | |
| uses: linear/linear-release-action@v0 | |
| with: | |
| access_key: ${{ secrets.LINEAR_ACCESS_KEY }} | |
| command: sync | |
| # Only the storefront package ships as its own release; changes to | |
| # other workspace packages (client, create-catalyst, the CLI) are | |
| # released separately and shouldn't count toward this pipeline. | |
| include_paths: core/** | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| # Runs `changeset version`, then syncs core/package.json's `catalyst` | |
| # field (version + git ref) to the freshly-bumped version. | |
| version: pnpm changeset:version | |
| publish: pnpm exec changeset publish | |
| title: "Version Packages (`${{ github.ref_name }}`)" | |
| commit: "Version Packages (`${{ github.ref_name }}`)" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Resolve headline package | |
| id: headline | |
| if: steps.changesets.outputs.published == 'true' | |
| run: | | |
| PACKAGE_NAME="@bigcommerce/catalyst-core" | |
| if [ "${{ github.ref_name }}" = "integrations/makeswift" ]; then | |
| PACKAGE_NAME="@bigcommerce/catalyst-makeswift" | |
| fi | |
| VERSION=$(echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r --arg name "$PACKAGE_NAME" '.[] | select(.name == $name) | .version') | |
| if [ -z "$VERSION" ]; then | |
| echo "found=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "found=true" >> "$GITHUB_OUTPUT" | |
| echo "tag=$PACKAGE_NAME@$VERSION" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Fetch release notes | |
| if: steps.headline.outputs.found == 'true' | |
| run: gh release view "${{ steps.headline.outputs.tag }}" --json body -q .body > /tmp/release-notes.md | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Complete Linear release | |
| if: steps.headline.outputs.found == 'true' | |
| uses: linear/linear-release-action@v0 | |
| with: | |
| access_key: ${{ secrets.LINEAR_ACCESS_KEY }} | |
| command: complete | |
| version: ${{ steps.headline.outputs.tag }} | |
| release_notes: /tmp/release-notes.md |