From bbd0c81619cfab36db9a1fd2ab2c59f5ecebee2f Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Wed, 14 Feb 2024 03:41:33 -0800 Subject: [PATCH] update workflow --- .github/workflows/release.yml | 45 +++++++++++++++++++++-------------- package.json | 4 ++-- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e598381..515dbcb2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,29 +1,38 @@ -name: Release +name: Changesets on: push: branches: - main -concurrency: ${{ github.workflow }}-${{ github.ref }} -permissions: {} #reset +env: + CI: true + PNPM_CACHE_FOLDER: .pnpm-store jobs: - release: - # IMPORTANT: prevent this action from running on forks - if: github.repository == 'MatthiesenXYZ/astro-ghostcms' - permissions: - contents: write # to create release (changesets/action) - pull-requests: write # to create pull request (changesets/action) - name: Release + version: + timeout-minutes: 15 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - name: checkout code repository + uses: actions/checkout@v3 with: - node-version: 20 - - name: Publish to npm - id: changesets + fetch-depth: 0 + - name: setup node.js + uses: actions/setup-node@v3 + with: + node-version: 14 + - name: install pnpm + run: npm i pnpm@latest -g + - name: Setup npmrc + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc + - name: setup pnpm config + run: pnpm config set store-dir $PNPM_CACHE_FOLDER + - name: install dependencies + run: pnpm install + - name: create and publish versions uses: changesets/action@v1 with: - publish: npm run release + version: pnpm ci:version + commit: "chore: update versions" + title: "chore: update versions" + publish: pnpm ci:publish env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/package.json b/package.json index e8144223..17c2b9da 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ }, "scripts": { "lint": "biome check .", - "changeset": "changeset", - "release": "changeset publish", + "ci:version": "pnpm changeset version", + "vi:publish": "pnpm changeset publish", "lint:fix": "biome check --apply .", "playground:dev": "pnpm --filter playground dev", "api:test": "pnpm --filter astro-ghostcms test",