From a36e228b53ccb6d0bdcdc0c56a633e228434bfa4 Mon Sep 17 00:00:00 2001 From: Anthony Frehner Date: Mon, 17 Oct 2022 14:46:36 -0600 Subject: [PATCH] CI action for publishing the next version automatically (#8) * CI action for publishing the next version automatically * remove output to file --- .github/workflows/changesets.yml | 17 +++++++++++++++-- CONTRIBUTING.md | 2 +- package.json | 4 ++-- packages/react/package.json | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml index 31a171a2..965d0247 100644 --- a/.github/workflows/changesets.yml +++ b/.github/workflows/changesets.yml @@ -36,7 +36,7 @@ jobs: - name: Install the packages run: yarn install --frozen-lockfile --ignore-engines - - name: Create Release Pull Request or Publish (for latest release) + - name: (latest) Create Release Pull Request or Publish if: steps.flags.outputs.latest == 'true' id: changesets uses: changesets/action@v1 @@ -49,7 +49,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Create Release Pull Request or Publish (for legacy patch release) + - name: (legacy) Create Release Pull Request or Publish if: steps.flags.outputs.latest != 'true' id: changesets_legacy uses: changesets/action@v1 @@ -61,3 +61,16 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + # note that this runs on every PR that's merged. + - name: (next) Create Release Pull Request or Publish + id: changesets_next + uses: changesets/action@v1 + with: + version: yarn changeset version --snapshot next + publish: yarn changeset publish --tag next + commit: '[ci] release ${{ github.ref_name }}' + title: '[ci] release ${{ github.ref_name }}' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bb1c8bf3..6900dbae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ There are two ways you can develop Hydrogen-UI components: 2. Edit the component or the component's story `[ComponentName].stories.tsx` - TODO: setup and document how to link this package to the demo store diff --git a/package.json b/package.json index ef9f0a12..0a5f01d9 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,13 @@ ], "scripts": { "build": "turbo run build", + "ci:checks": "turbo run typecheck test:ci lint format:check", "dev": "turbo run dev --parallel", "lint": "run-p lint:js lint:language", "lint:js": "eslint --no-error-on-unmatched-pattern --ext .js,.ts,.jsx,.tsx packages/*/src", "lint:language": "alex {.,.changeset}", "format": "prettier --write --ignore-unknown .", - "format:check": "prettier --check --ignore-unknown .", - "ci:checks": "turbo run typecheck test:ci lint format:check" + "format:check": "prettier --check --ignore-unknown ." }, "devDependencies": { "@changesets/cli": "^2.25.0", diff --git a/packages/react/package.json b/packages/react/package.json index d897fe48..ca5ceccb 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,5 +1,5 @@ { - "name": "@hydrogen/react", + "name": "@shopify/hydrogen-react", "version": "2022.7.0", "description": "React components, hooks, and utilities for creating custom Shopify storefronts", "homepage": "https://github.com/Shopify/hydrogen-ui/tree/main/packages/react",