Merge 2025-10 changes into 2026-01-rc (#3734) #559
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: Deploy | |
| on: | |
| push: | |
| branches: | |
| # Stable version branches | |
| - 2023-04 | |
| - 2023-07 | |
| - 2023-10 | |
| - 2024-01 | |
| - 2024-04 | |
| - 2024-07 | |
| - 2024-10 | |
| - 20[0-9][0-9]-[01][1470] | |
| # RC version branches | |
| - 20[0-9][0-9]-[01][1470]-rc | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| # Snapit job - runs when /snapit comment is made on a PR | |
| snapit: | |
| name: Snapit | |
| if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == '/snapit' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| # WARNING: DO NOT RUN ANY CUSTOM LOCAL SCRIPT BEFORE RUNNING THE SNAPIT ACTION | |
| # This action can be executed by 3rd party users and it should not be able to run arbitrary code from a PR. | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} | |
| - uses: ./.github/workflows/actions/prepare | |
| - name: Update npm to 11.7 | |
| run: npm install -g npm@11.7 | |
| - name: Create snapshot | |
| uses: Shopify/snapit@v0.1.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} | |
| NPM_TOKEN: '' | |
| NPM_CONFIG_PROVENANCE: true | |
| with: | |
| build_script: yarn build | |
| comment_command: /snapit | |
| changesets: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # Required for OIDC | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} | |
| - uses: ./.github/workflows/actions/prepare | |
| - name: Update npm to latest | |
| run: npm install -g npm@latest | |
| - id: changesets | |
| name: Create release Pull Request or publish to NPM | |
| uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3 | |
| with: | |
| title: Version Packages (${{ github.ref_name }}) | |
| publish: yarn run deploy ${{ !endsWith(github.ref_name, '-rc') && format('--tag {0}', github.ref_name) || '' }} # no tag for RC branches. | |
| createGithubReleases: false | |
| env: | |
| NPM_TOKEN: '' # Forces OIDC authentication | |
| GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} | |
| # Known to fail in OIDC (https://github.com/npm/cli/issues/8547). | |
| # Workaround is to manually ask #help-eng-infrastructure to update `latest` tag. | |
| - name: Set 'latest' NPM dist tag | |
| if: steps.changesets.outputs.published == 'true' && github.ref_name == vars.LATEST_STABLE_VERSION | |
| env: | |
| PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }} | |
| run: | | |
| for pkg in $(echo "$PUBLISHED_PACKAGES" | jq -r '.[] | @base64'); do | |
| _jq() { | |
| echo ${pkg} | base64 --decode | jq -r ${1} | |
| } | |
| npm dist-tag add $(_jq '.name')@$(_jq '.version') latest | |
| done |