From 7c762d69a1b2275b5a74a6dc01995f27c93f8ac0 Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Mon, 3 Feb 2025 23:22:10 +0100 Subject: [PATCH 1/3] add release flow --- .changeset/config.json | 2 +- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 4 ++-- .nvmrc | 1 + 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .nvmrc diff --git a/.changeset/config.json b/.changeset/config.json index 91b6a9512..fce1c2654 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -4,7 +4,7 @@ "commit": false, "fixed": [], "linked": [], - "access": "restricted", + "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..2690c7bda --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +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 + + - name: Setup Node.js 22.13.1 + uses: actions/setup-node@v3 + with: + node-version: 22.13.1 + + - name: Install Dependencies + run: pnpm i --frozen-lockfile + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + publish: pnpm run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b680ccbf..1cf4a32ed 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Node.js + - name: Setup Node.js 22.13.1 uses: actions/setup-node@v4 with: - node-version: "22" + node-version: 22.13.1 - name: Install pnpm uses: pnpm/action-setup@v4 diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..d5b283a3a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22.13.1 From 9002774624c5a8dd7ec70c4c30e7b6e28598e683 Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Mon, 3 Feb 2025 23:24:02 +0100 Subject: [PATCH 2/3] remove code duplication --- .github/workflows/release.yml | 7 ++++--- .github/workflows/test.yml | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2690c7bda..6b47148ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,10 +15,11 @@ jobs: - name: Checkout Repo uses: actions/checkout@v3 - - name: Setup Node.js 22.13.1 - uses: actions/setup-node@v3 + - name: Use Node.js from nvmrc + uses: actions/setup-node@v4 with: - node-version: 22.13.1 + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org' - name: Install Dependencies run: pnpm i --frozen-lockfile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1cf4a32ed..ca2bf1ff3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Node.js 22.13.1 + - name: Use Node.js from nvmrc uses: actions/setup-node@v4 with: - node-version: 22.13.1 + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org' - name: Install pnpm uses: pnpm/action-setup@v4 From 64bfab8ed19c6c9a645618f58feec0f3f6693ab4 Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Tue, 4 Feb 2025 15:51:50 +0100 Subject: [PATCH 3/3] add pnpm --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b47148ea..aedca9c63 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + with: + # https://github.com/pnpm/pnpm/issues/8953 + version: 9.15.3 - name: Use Node.js from nvmrc uses: actions/setup-node@v4