From 5c840565d60a36a999dba763c0deab5a857a7a05 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Tue, 3 Jun 2025 23:17:24 -0500 Subject: [PATCH 1/9] chore(ci): combine issue workflows --- .github/workflows/issue-edited.yml | 15 --------------- .github/workflows/issue-opened.yml | 15 --------------- .github/workflows/issue.yml | 16 ++++++++++++++++ 3 files changed, 16 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/issue-edited.yml delete mode 100644 .github/workflows/issue-opened.yml create mode 100644 .github/workflows/issue.yml diff --git a/.github/workflows/issue-edited.yml b/.github/workflows/issue-edited.yml deleted file mode 100644 index 4e4b9d89..00000000 --- a/.github/workflows/issue-edited.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: issue edited - -on: - issues: - types: - - edited - - labeled - -jobs: - move-issue-to-backlog: - name: move issue to backlog - uses: bombshell-dev/automation/.github/workflows/move-issue-to-backlog.yml@main - secrets: - BOT_APP_ID: ${{ secrets.BOT_APP_ID }} - BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }} diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml deleted file mode 100644 index c53ed9b3..00000000 --- a/.github/workflows/issue-opened.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Issue opened - -on: - issues: - types: - - reopened - - opened - -jobs: - add-issue-to-project: - name: add issue to project - uses: bombshell-dev/automation/.github/workflows/add-issue-to-project.yml@main - secrets: - BOT_APP_ID: ${{ secrets.BOT_APP_ID }} - BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }} diff --git a/.github/workflows/issue.yml b/.github/workflows/issue.yml new file mode 100644 index 00000000..f35f934e --- /dev/null +++ b/.github/workflows/issue.yml @@ -0,0 +1,16 @@ +name: issue + +on: + issues: + types: [opened, edited, labeled, reopened] + +jobs: + backlog: + if: github.event.action == 'edited' || github.event.action == 'labeled' + uses: bombshell-dev/automation/.github/workflows/move-issue-to-backlog.yml@main + secrets: inherit + + project: + if: github.event.action == 'opened' || github.event.action == 'reopened' + uses: bombshell-dev/automation/.github/workflows/add-issue-to-project.yml@main + secrets: inherit From a4d129a549db3f3b64a19afafa6b8d93a45f67cb Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Tue, 3 Jun 2025 23:19:02 -0500 Subject: [PATCH 2/9] chore(ci): use shared preview workflow --- .github/workflows/preview.yml | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index c2c7a962..be6d6c30 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -1,26 +1,15 @@ name: Preview -on: [push, pull_request] -jobs: - build: - if: github.repository == 'bombshell-dev/clack' - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install pnpm - uses: pnpm/action-setup@v4 +on: + push: + pull_request: + workflow_dispatch: - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: https://registry.npmjs.org/ - cache: "pnpm" - - - name: Install dependencies - run: pnpm install - - - run: pnpx pkg-pr-new publish './packages/*' --template './examples/*' +jobs: + format: + if: github.repository_owner == 'bombshell-dev' + uses: bombshell-dev/automation/.github/workflows/preview.yml@main + secrets: inherit + with: + publish: "./packages/*" + template: "./examples/*" From cd81cd6898d8e2e79b940ce91086cdb621017172 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Tue, 3 Jun 2025 23:21:14 -0500 Subject: [PATCH 3/9] chore(ci): replace release with shared publish --- .github/workflows/publish.yml | 17 +++++++++++++++ .github/workflows/release.yml | 40 ----------------------------------- 2 files changed, 17 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..789c6298 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,17 @@ +name: Publish + +on: + push: + branches: [main, v0] + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + packages: write + +jobs: + publish: + if: github.repository_owner == 'bombshell-dev' + uses: bombshell-dev/automation/.github/workflows/publish.yml@main + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 485f4b5a..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Release - -on: - push: - branches: [main, v0] - -permissions: - contents: write - pull-requests: write - packages: write - -# Automatically cancel in-progress actions on the same branch -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} - cancel-in-progress: true - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" - - run: pnpm run ci:install - - run: pnpm run ci:prepublish - - name: Create Release Pull Request or Publish to npm - id: changesets - uses: changesets/action@v1 - with: - version: pnpm run ci:version - publish: pnpm run ci:publish - commit: "[ci] release" - title: "[ci] release" - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 9da0b953887b87fbcbc083ef9beac73c3d8ebeed Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Tue, 3 Jun 2025 23:22:58 -0500 Subject: [PATCH 4/9] chore(contributing): remove ci:* scripts --- CONTRIBUTING.md | 9 +-------- package.json | 6 +----- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index df073e6a..ff297bc1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -283,14 +283,7 @@ Clack uses [Changesets](https://github.com/changesets/changesets) to manage vers 2. **For maintainers**: - Merging PRs with changesets will queue them for the next release - - When ready to release: - ```bash - # Update versions based on changesets - pnpm ci:version - - # Publish to npm - pnpm ci:publish - ``` + - When ready to release, merge the `[ci] release` PR ### Backporting to v0 Branch diff --git a/package.json b/package.json index e7762485..ecf5d0fa 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,7 @@ "lint": "biome lint --write --unsafe", "types": "biome lint --write --unsafe", "deps": "pnpm exec knip --production", - "test": "pnpm --color -r run test", - "ci:install": "pnpm install --no-frozen-lockfile", - "ci:version": "changeset version", - "ci:publish": "changeset publish", - "ci:prepublish": "pnpm build" + "test": "pnpm --color -r run test" }, "devDependencies": { "@biomejs/biome": "1.9.4", From cbd6d84c6cc7b347031a7f43201f84985f10c13e Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Tue, 3 Jun 2025 23:49:44 -0500 Subject: [PATCH 5/9] chore(ci): combine lint and ci workflows --- .github/workflows/ci.yml | 30 ++++++++++++++---------------- .github/workflows/lint.yml | 25 ------------------------- 2 files changed, 14 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23766212..0dfba449 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,21 +8,19 @@ on: # Automatically cancel in-progress actions on the same branch concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: - build: - name: Build Packages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" - - run: pnpm install - - run: pnpm run build - - run: pnpm run types - - run: pnpm run test + ci: + if: github.repository_owner == 'bombshell-dev' + uses: bombshell-dev/automation/.github/workflows/run.yml@main + secrets: inherit + with: + commands: > + [ + "build", + "types", + "test", + "deps" + ] diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 7ad223de..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Lint - -on: - push: - branches: - - main - pull_request: - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" - - run: pnpm install - - run: pnpm run build - - run: pnpm run types - - run: pnpm run deps - env: - NODE_ENV: production From cb9e82b9c9779b60f48cd172079d9cd9f393e046 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Wed, 4 Jun 2025 00:25:20 -0500 Subject: [PATCH 6/9] fix(ci): run build before test --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ecf5d0fa..39950050 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "lint": "biome lint --write --unsafe", "types": "biome lint --write --unsafe", "deps": "pnpm exec knip --production", - "test": "pnpm --color -r run test" + "test": "pnpm --color -r run test", + "pretest": "pnpm run build" }, "devDependencies": { "@biomejs/biome": "1.9.4", From 10289d5d50084bbfd00219cf46a086c7158f9025 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Wed, 4 Jun 2025 17:47:27 -0500 Subject: [PATCH 7/9] fix(ci): scope preview push events --- .github/workflows/preview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index be6d6c30..5728bb2f 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -2,6 +2,8 @@ name: Preview on: push: + branches: + - main pull_request: workflow_dispatch: From 45a29bfdff6c478333f1b3ff6844a054d20f2812 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Wed, 4 Jun 2025 17:48:39 -0500 Subject: [PATCH 8/9] fix(ci): rename preview job --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 5728bb2f..82718532 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - format: + preview: if: github.repository_owner == 'bombshell-dev' uses: bombshell-dev/automation/.github/workflows/preview.yml@main secrets: inherit From 3641b71575d92510e34f5e53dc99e2dd7716b021 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Wed, 4 Jun 2025 17:49:09 -0500 Subject: [PATCH 9/9] fix(ci): rename ci scripts --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0dfba449..45bb1d37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: - ci: + scripts: if: github.repository_owner == 'bombshell-dev' uses: bombshell-dev/automation/.github/workflows/run.yml@main secrets: inherit