From 505f0d6e732f0b7489e6cd63c6adba82d46b040a Mon Sep 17 00:00:00 2001 From: Christian van der Loo Date: Wed, 21 Aug 2024 21:42:29 -0400 Subject: [PATCH] chore: unify publishing --- .github/workflows/ci.yml | 47 ++++++++++++++++++---------- .github/workflows/release-please.yml | 33 ------------------- 2 files changed, 31 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f91ca8..730fdd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,24 +2,39 @@ name: Test & Build on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] jobs: - build: + test-and-build: + name: Test & Build runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x, 18.x] steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm i -g yarn - - run: yarn - - run: yarn test - - run: yarn build + - uses: actions/checkout@v3 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - run: bun i && bun test && bun run build + release-please: + name: Release Please + runs-on: ubuntu-latest + steps: + - id: release + uses: google-github-actions/release-please-action@v3 + with: + release-type: node + package-name: zustand-computed + release: + name: Create NPM Release + runs-on: ubuntu-latest + needs: [release-please, test-and-build] + if: ${{ needs.release-please.outputs.release_created }} + steps: + - uses: actions/checkout@v2 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - run: bunx npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index 4f90faf..0000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,33 +0,0 @@ -on: - push: - branches: - - main - -permissions: - contents: write - pull-requests: write - -name: Release - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - id: release - uses: google-github-actions/release-please-action@v3 - with: - release-type: node - package-name: zustand-computed - - uses: actions/checkout@v2 - if: ${{ steps.release.outputs.release_created }} - - uses: actions/setup-node@v2 - with: - node-version: 18 - registry-url: 'https://registry.npmjs.org' - if: ${{ steps.release.outputs.release_created }} - - run: npm i -g yarn && yarn && yarn test && yarn build - if: ${{ steps.release.outputs.release_created }} - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - if: ${{ steps.release.outputs.release_created }}