Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chilly-ghosts-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/ui-extensions': patch
---

new oidc deploy workflow
5 changes: 3 additions & 2 deletions .github/workflows/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name: Prepare repo
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
name: Setup node.js and yarn
with:
registry-url: 'https://registry.npmjs.org' # Required for OIDC
cache: yarn
node-version-file: '.nvmrc'
node-version-file: '.nvmrc' # Must be 20+ to support npm 11.5.1+

- name: Yarn install
run: yarn install --frozen-lockfile
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/deploy-rc.yml

This file was deleted.

19 changes: 12 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Deploy
on:
push:
branches:
# Stable version branches
- 2023-04
- 2023-07
- 2023-10
Expand All @@ -11,40 +12,44 @@ on:
- 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:
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@06245a4e0a36c064a573d4150030f5ec548e4fcc # v1.4.10
uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3
with:
title: Version Packages (${{ github.ref_name }})
publish: yarn run deploy --tag ${{ github.ref_name }}
publish: yarn run deploy --tag ${{ endsWith(github.ref_name, '-rc') && 'rc' || github.ref_name }} # RC publishes as `rc` tag, stable publishes as the version number
createGithubReleases: false
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: '' # Forces OIDC authentication
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}
Expand Down