From aacfea5c401b4f55e287a2fa8c801977946777e3 Mon Sep 17 00:00:00 2001 From: jpb06 Date: Sun, 16 Feb 2025 15:51:23 +0100 Subject: [PATCH] chore: using release please --- .github/workflows/ci.yml | 15 ----- .../workflows/coverage-badges-generation.yml | 4 -- .github/workflows/publish.yml | 53 ----------------- .github/workflows/release.yml | 58 +++++++++++++++++++ 4 files changed, 58 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e072865..115625c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,9 +19,6 @@ jobs: name: âŦŖ ESLint runs-on: ubuntu-latest steps: - - name: 🛑 Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - - name: âŦ‡ī¸ Checkout repo uses: actions/checkout@v4 @@ -32,7 +29,6 @@ jobs: uses: actions/setup-node@v4 with: node-version-file: '.node-version' - # cache: 'bun' cache-dependency-path: ./package.json - name: đŸ“Ĩ Install deps @@ -45,9 +41,6 @@ jobs: name: ĘĻ TypeScript runs-on: ubuntu-latest steps: - - name: 🛑 Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - - name: âŦ‡ī¸ Checkout repo uses: actions/checkout@v4 @@ -58,7 +51,6 @@ jobs: uses: actions/setup-node@v4 with: node-version-file: '.node-version' - # cache: 'bun' cache-dependency-path: ./package.json - name: đŸ“Ĩ Install deps @@ -71,9 +63,6 @@ jobs: name: đŸŽ¯ Tests runs-on: ubuntu-latest steps: - - name: 🛑 Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - - name: âŦ‡ī¸ Checkout repo uses: actions/checkout@v4 @@ -84,7 +73,6 @@ jobs: uses: actions/setup-node@v4 with: node-version-file: '.node-version' - # cache: 'bun' cache-dependency-path: ./package.json - name: đŸ“Ĩ Install deps @@ -104,9 +92,6 @@ jobs: runs-on: ubuntu-latest needs: [lint, typecheck, test] steps: - - name: 🛑 Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - - name: âŦ‡ī¸ Checkout repo uses: actions/checkout@v4 diff --git a/.github/workflows/coverage-badges-generation.yml b/.github/workflows/coverage-badges-generation.yml index dd15a49..2949825 100644 --- a/.github/workflows/coverage-badges-generation.yml +++ b/.github/workflows/coverage-badges-generation.yml @@ -11,9 +11,6 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - name: 🛑 Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - - name: âŦ‡ī¸ Checkout repo uses: actions/checkout@v4 with: @@ -27,7 +24,6 @@ jobs: with: node-version-file: '.node-version' registry-url: 'https://registry.npmjs.org' - # cache: 'bun' cache-dependency-path: ./package.json - name: đŸ“Ĩ Install deps diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 2ce5e2c..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: ⚡ Publish - -on: - workflow_run: - workflows: ['⚡ Coverage badges generation'] - types: - - completed - -jobs: - publish: - name: đŸ›Šī¸ Publish - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: 🛑 Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - - - name: âŦ‡ī¸ Checkout repo - uses: actions/checkout@v4 - - - name: đŸ“Ļ Setup bun - uses: oven-sh/setup-bun@v2 - - - name: ⎔ Setup node - uses: actions/setup-node@v4 - with: - node-version-file: '.node-version' - registry-url: 'https://registry.npmjs.org' - # cache: 'bun' - cache-dependency-path: ./package.json - - - name: đŸ“Ĩ Install deps - run: bun install --frozen-lockfile - - - name: âœī¸ Bump package version - id: bumping-version - uses: jpb06/bump-package@latest - with: - major-keywords: BREAKING CHANGE - minor-keywords: feat,minor - patch-keywords: fix,chore - should-default-to-patch: true - commit-user: jpb06 - commit-user-email: jpb.06@outlook.com - - - name: âš™ī¸ Building package - run: bun run build - - - name: 🚀 Publish package - if: steps.bumping-version.outputs.bump-performed == 'true' - run: npm publish ./dist --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b41fa52 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: ⚡ Release + +on: + workflow_run: + workflows: ['⚡ Integration checks'] + branches: [main] + types: + - completed + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + pull-requests: write + +jobs: + publish: + name: đŸ›Šī¸ Release & Publish + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: đŸ›°ī¸ Release please + uses: googleapis/release-please-action@v4 + id: release + with: + release-type: node + + - name: âŦ‡ī¸ Checkout repo + uses: actions/checkout@v4 + if: ${{ steps.release.outputs.release_created }} + + - name: đŸ“Ļ Setup bun + uses: oven-sh/setup-bun@v2 + if: ${{ steps.release.outputs.release_created }} + + - name: ⎔ Setup node + uses: actions/setup-node@v4 + if: ${{ steps.release.outputs.release_created }} + with: + node-version-file: '.node-version' + registry-url: 'https://registry.npmjs.org' + + - name: đŸ“Ĩ Install deps + if: ${{ steps.release.outputs.release_created }} + run: pnpm install --frozen-lockfile + + - name: âš™ī¸ Building package + if: ${{ steps.release.outputs.release_created }} + run: pnpm build + + - name: 🚀 Publish package + id: publish + if: ${{ steps.release.outputs.release_created }} + run: npm publish ./dist --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}