Merge pull request #3565 from Shopify/pos-ui-extensions-2025-01-api-p… #398
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: | |
| - 2023-04 | |
| - 2023-07 | |
| - 2023-10 | |
| - 2024-01 | |
| - 2024-04 | |
| - 2024-07 | |
| - 2024-10 | |
| - 20[0-9][0-9]-[01][1470] | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| changesets: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} | |
| - uses: ./.github/workflows/actions/prepare | |
| - id: changesets | |
| name: Create release Pull Request or publish to NPM | |
| uses: changesets/action@v1 | |
| with: | |
| title: Version Packages (${{ github.ref_name }}) | |
| publish: yarn run deploy --tag ${{ github.ref_name }} | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} | |
| - name: Set 'latest' NPM dist tag | |
| if: steps.changesets.outputs.published == 'true' && github.ref_name == vars.LATEST_STABLE_VERSION | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }} | |
| run: | | |
| cat << EOF > "$HOME/.npmrc" | |
| //registry.npmjs.org/:_authToken=$NPM_TOKEN | |
| EOF | |
| 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 |