diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23766212..45bb1d37 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 + scripts: + 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/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 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 diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index c2c7a962..82718532 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -1,26 +1,17 @@ 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: + branches: + - main + 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: + preview: + if: github.repository_owner == 'bombshell-dev' + uses: bombshell-dev/automation/.github/workflows/preview.yml@main + secrets: inherit + with: + publish: "./packages/*" + template: "./examples/*" 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 }} 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..39950050 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,7 @@ "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" + "pretest": "pnpm run build" }, "devDependencies": { "@biomejs/biome": "1.9.4",