From 567ca8c54b2947fa36bbe9f9582099873267501d Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Tue, 21 Nov 2023 11:58:33 -0500 Subject: [PATCH] Add automated release GH action --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..eb13937004 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Setup Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + + - name: Install Dependencies + run: yarn + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + # This expects you to have a script called release which does a build for your packages and calls changeset publish + publish: yarn release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index f6b34da595..e09e0e4c3f 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "version:prepare": "yarn changeset version", "version:check": "yarn changeset status", "publish:all": "yarn changeset publish", + "release": "yarn build && yarn version:check && yarn publish:all", "postinstall": "husky install" }, "workspaces": [