Skip to content

Commit

Permalink
Merge pull request #1352 from Shopify/rd/internal-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-drexler authored Sep 19, 2023
2 parents bd5647a + c4f50e0 commit e3296a5
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/internal-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Internal Snapshot

on:
workflow_dispatch:
push:
branches:
- internal

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
internal-snapshot:
name: Internal Snapshot
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }}

- uses: ./.github/workflows/actions/prepare

- name: Create an .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
- name: Deploy snapshot versions
run: yarn run deploy:internal
env:
GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }}
2 changes: 2 additions & 0 deletions documentation/versions-and-deploys.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ When changeset files are detected on any of the stable version branches, a GitHu

The `unstable` branch does not have the additional step of creating a PR to merge changesets “on-demand”. Instead, _every_ merge into `unstable` causes a new set of versions to be published to NPM. A GitHub action watches this branch and, when any changes are detected, it will create a [“snapshot release”](https://github.com/changesets/changesets/blob/main/docs/snapshot-releases.md) that publishes the changed packages as they exist at that point in time. Snapshot versions have the format `0.0.0-unstable-{{TIMESTAMP}}`, and are published to NPM with the `unstable` tag. This allows developers to get the latest `unstable` version of a package by running an install command referencing the `unstable` tag, like `yarn add @shopify/ui-extensions@unstable`.

Like the `unstable` branch, the `internal` branch also publishes snapshot releases to NPM. These releases are identified by the format `0.0.0-internal-{{TIMESTAMP}}` and are published with the `internal` tag.

## Creating new stable versions

> **Note:** only members of the [UI Extension Stewards GitHub team](https://github.com/orgs/Shopify/teams/ui-extension-stewards) should create new stable versions.
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"docs:admin": "yarn workspace @shopify/ui-extensions docs:admin",
"docs:checkout": "yarn workspace @shopify/ui-extensions docs:checkout",
"deploy:unstable": "changeset version --snapshot unstable && changeset publish --tag unstable --no-git-tag",
"predeploy:internal": "yarn build",
"deploy:internal": "changeset version --snapshot internal && changeset publish --tag internal --no-git-tag",
"gen-docs:admin": "yarn workspace @shopify/ui-extensions gen-docs:admin",
"lint": "loom lint",
"nuke": "rm -rf node_modules && yarn cache clean && rm -rf .loom && git clean -xdf ./packages; rm -rf ./build",
Expand Down

0 comments on commit e3296a5

Please sign in to comment.