From 16e798c3f4d2aa14c1c06a52899a9527f8c1c841 Mon Sep 17 00:00:00 2001 From: Mitch Lillie Date: Fri, 22 Nov 2024 13:56:22 -0800 Subject: [PATCH] Remove create stable version action, add regex for watched branches --- .github/workflows/changesets-reminder.yml | 1 + .github/workflows/create-stable-version.yml | 56 --------------------- .github/workflows/deploy.yml | 1 + documentation/versions-and-deploys.md | 5 +- 4 files changed, 5 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/create-stable-version.yml diff --git a/.github/workflows/changesets-reminder.yml b/.github/workflows/changesets-reminder.yml index 784f20e154..d29900eba8 100644 --- a/.github/workflows/changesets-reminder.yml +++ b/.github/workflows/changesets-reminder.yml @@ -12,6 +12,7 @@ on: - 2024-07 - 2024-10 - unstable + - 20[0-9][0-9]-[01][1470] paths: - 'packages/*/src/**' - 'packages/*/package.json' diff --git a/.github/workflows/create-stable-version.yml b/.github/workflows/create-stable-version.yml deleted file mode 100644 index 22834025e0..0000000000 --- a/.github/workflows/create-stable-version.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Create Stable Version - -on: - workflow_dispatch: - inputs: - version: - description: 'New stable version (YYYY-MM)' - required: true - type: string - -jobs: - create-stable-version: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: "16" - - - name: Create new branch - run: | - git checkout -b ${{ github.event.inputs.version }} origin/unstable - git push -u origin ${{ github.event.inputs.version }} - - # Note: The following steps currently fail. I am working with the infra team to see if we can - # get a token with the requisite permissions. - - name: Create branch protection rule - uses: octokit/request-action@v2.x - with: - route: PUT /repos/{owner}/{repo}/branches/{branch}/protection - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - branch: ${{ github.event.inputs.version }} - required_status_checks: '{"strict": true, "contexts": []}' - enforce_admins: 'true' - required_pull_request_reviews: '{"required_approving_review_count": 1}' - restrictions: 'null' - env: - GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - - - name: Update LATEST_STABLE_VERSION - uses: octokit/request-action@v2.x - with: - route: PATCH /repos/{owner}/{repo}/actions/variables/LATEST_STABLE_VERSION - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - name: LATEST_STABLE_VERSION - value: ${{ github.event.inputs.version }} - env: - GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b052c7ae92..dedf5f24d0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,6 +10,7 @@ on: - 2024-04 - 2024-07 - 2024-10 + - 20[0-9][0-9]-[01][1470] concurrency: ${{ github.workflow }}-${{ github.ref }} diff --git a/documentation/versions-and-deploys.md b/documentation/versions-and-deploys.md index 955f57f040..11935de36d 100644 --- a/documentation/versions-and-deploys.md +++ b/documentation/versions-and-deploys.md @@ -45,11 +45,12 @@ Like the `unstable` branch, the `internal` branch also publishes snapshot releas To create a new stable version, you will need to follow these steps: -1. Add the new stable calver version `YYYY-MM` to the list of watched branches in the [`changesets-reminder`](https://github.com/Shopify/ui-extensions/blob/unstable/.github/workflows/changesets-reminder.yml) and [`deploy`](https://github.com/Shopify/ui-extensions/blob/unstable/.github/workflows/deploy.yml) GitHub actions. -1. Run the "create stable version" action. +1. Create a new branch for the calver version you set from the previous step. This branch should be named with the format `YYYY-MM`. You will likely branch off of `unstable` to create this branch. +1. Push your new branch to GitHub. This will trigger the GitHub action that creates a new PR to consume all the changesets you copied over from `unstable` into your new version. 1. Pull down the branch that that was created by the GitHub action (it should have the name `changeset-release/{{BRANCH_NAME}}`). Instead of the patch version changes that were made by the action, update the version of all packages manually to be the first patch release of a new version range. For example, if you are creating a `2025-01` API version, you will set the package versions of all packages to `2025.1.0`. Apply this change to `packages/ui-extensions/package.json`, `packages/ui-extensions/CHANGELOG.md`, `packages/ui-extensions-react/package.json`, and `packages/ui-extensions-react/CHANGELOG.md`. > Note: do not update the root-level `package.json`. 1. Push your new changes, and make sure you get the PR reviewed by one other member of the [UI Extension Stewards GitHub team](https://github.com/orgs/Shopify/teams/ui-extension-stewards). +1. Update the [`LATEST_STABLE_VERSION`](https://github.com/Shopify/ui-extensions/settings/variables/actions) repository variable to your stable version (i.e. `2025-01`). This ensures means it will be marked with a `latest` npm dist-tag on NPM. 1. Merge the PR, and let robots release the new versions to NPM and tag it appropriately. 1. For any changes from `unstable` that have been incorporated into the new version, delete their changeset files on the `unstable` branch and replace the existing `CHANGELOG.md` files in `unstable` with what was just shipped. 1. Send a message announcing the release. Let teams know that now is the time to update their section's docs and CLI templates.