diff --git a/.copier-answers.ci.yml b/.copier-answers.ci.yml new file mode 100644 index 0000000..92cc805 --- /dev/null +++ b/.copier-answers.ci.yml @@ -0,0 +1,13 @@ +# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY +_commit: c91d4da +_src_path: gh:athackst/ci +automerge_mode: poll +bump_script_path: '' +do_releases: true +release_template: '## What''s changed + + + $CHANGES + + ' +site_generator: none diff --git a/.github/ci-config.yml b/.github/ci-config.yml new file mode 100644 index 0000000..8dcfe75 --- /dev/null +++ b/.github/ci-config.yml @@ -0,0 +1,118 @@ +# This file is generated from athackst/ci/template/.github/ci-config.yml.jinja. +# Do not edit directly; update the template instead. + +name-template: "Release v$RESOLVED_VERSION" +tag-template: "v$RESOLVED_VERSION" +template-file: ".github/release_template.md" +categories: + - title: ':zap: Breaking' + labels: + - 'breaking' + - 'major' + - title: ':rocket: New' + labels: + - 'feature' + - 'enhancement' + - title: ':bug: Bug Fixes' + labels: + - 'bug' + - 'fix' + - title: ':toolbox: Maintenance' + labels: + - 'maintenance' + - 'devops' + - title: ':memo: Documentation' + labels: + - 'docs' + - 'documentation' + - title: 'Dependency Updates' + label: 'dependencies' + collapse-after: 3 + +exclude-labels: + - 'skip-changelog' + +version-resolver: + major: + labels: + - 'breaking' + - 'major' + minor: + labels: + - 'feature' + - 'minor' + - 'enhancement' + patch: + labels: + - 'bug' + - 'fix' + - 'maintenance' + - 'docs' + - 'documentation' + - 'devops' + - 'dependencies' + - 'security' + +labels: + breaking: + - head-branch: ["^major", "^break"] + - description: "Breaking or major-version change" + - color: "#7f1d1d" + + bug: + - head-branch: ['^fix', '^bug'] + - description: "Something isn't working" + - color: "#d73a4a" + + enhancement: + - head-branch: ["^feat", "^new", "^enhance"] + - description: "New feature or request" + - color: "#0f766e" + + maintenance: + - head-branch: ['^chore', '^maint', '^noop', '^no-op', '^upkeep', '^dev'] + - changed-files: + - any-glob-to-any-file: [".github/**", ".vscode/**"] + - description: "Non-behavior related change" + - color: "#0ea5e9" + + dependencies: + - head-branch: ['^deps', '^dependencies'] + - description: "Pull requests that update a dependency file" + - color: "#1d4ed8" + + documentation: + - changed-files: + - any-glob-to-any-file: "**/*.md" + - head-branch: ["^doc"] + - description: "Improvements or additions to documentation" + - color: "#64748b" + + automerge: + - head-branch: ['^dependabot/'] + - description: "Automatically merge" + - color: "#eab308" + + good first issue: + - description: "Good for newcomers" + - color: "#c4b5fd" + + help wanted: + - description: "Extra attention is needed" + - color: "#db2777" + + question: + - description: "Further information is requested" + - color: "#7e22ce" + + duplicate: + - description: "This is a duplicate" + - color: "#cbd5e1" + + invalid: + - description: "This doesn't seem right" + - color: "#a3a3a3" + + wontfix: + - description: "This will not be worked on" + - color: "#78716c" diff --git a/.github/release_template.md b/.github/release_template.md new file mode 100644 index 0000000..4589af8 --- /dev/null +++ b/.github/release_template.md @@ -0,0 +1,5 @@ + + +## What's changed + +$CHANGES diff --git a/.github/workflows/ci_update.yml b/.github/workflows/ci_update.yml new file mode 100644 index 0000000..3103487 --- /dev/null +++ b/.github/workflows/ci_update.yml @@ -0,0 +1,30 @@ + +# This file is generated from athackst/ci/template/.github/workflows/ci_update.yml.jinja. +# Do not edit directly; update the template instead. + +name: CI Update + +on: + schedule: + - cron: "0 15 * * *" + workflow_dispatch: + +concurrency: + group: "ci-update-${{ github.ref }}" + cancel-in-progress: false + +jobs: + ci-update: + permissions: + contents: write + pull-requests: write + # Required for creating an issue if the workflow fails + issues: write + # Required in this environment to allow PRs that modify .github/workflows/*. + actions: write + uses: athackst/ci/.github/workflows/ci_updater.yml@main + with: + create-pr: true + automerge: true + secrets: + token: ${{ secrets.CI_BOT_TOKEN }} diff --git a/.github/workflows/pr_automerge.yml b/.github/workflows/pr_automerge.yml new file mode 100644 index 0000000..46b1bbd --- /dev/null +++ b/.github/workflows/pr_automerge.yml @@ -0,0 +1,27 @@ +# This file is generated from athackst/ci/template/.github/workflows/pr_automerge.yml.jinja. +# Do not edit directly; update the template instead. + +name: PR Automerge + +on: + pull_request_target: + types: + - labeled + - unlabeled + +concurrency: + group: "pr-automerge-${{ github.event.pull_request.number || github.ref }}" + cancel-in-progress: false + +jobs: + pr-automerge: + if: ${{ github.event.pull_request.state == 'open' }} + permissions: + contents: write + pull-requests: write + checks: read + uses: athackst/ci/.github/workflows/automerge.yml@main + with: + automerge-mode: poll + secrets: + token: ${{ secrets.CI_BOT_TOKEN }} diff --git a/.github/workflows/pr_labeler.yml b/.github/workflows/pr_labeler.yml new file mode 100644 index 0000000..573e353 --- /dev/null +++ b/.github/workflows/pr_labeler.yml @@ -0,0 +1,16 @@ +# This file is generated from athackst/ci/template/.github/workflows/pr_labeler.yml.jinja. +# Do not edit directly; update the template instead. + +name: PR Labeler + +on: + pull_request_target: + +jobs: + pr-label: + permissions: + contents: read + pull-requests: write + uses: athackst/ci/.github/workflows/labeler.yml@main + secrets: + token: ${{ secrets.CI_BOT_TOKEN }} diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml new file mode 100644 index 0000000..14678fb --- /dev/null +++ b/.github/workflows/release_draft.yml @@ -0,0 +1,35 @@ +# This file is generated from athackst/ci/template/.github/workflows/release_draft.yml.jinja. +# Do not edit directly; update the template instead. +name: Release Draft + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + release-draft: + permissions: + contents: write + pull-requests: read + uses: athackst/ci/.github/workflows/release_drafter.yml@main + with: + draft-release-id: ${{ vars.DRAFT_RELEASE_ID }} + secrets: + token: ${{ secrets.CI_BOT_TOKEN }} + + persist-draft-id: + needs: + - release-draft + permissions: + actions: write + runs-on: ubuntu-latest + steps: + - name: Persist draft release id + shell: bash + env: + GH_TOKEN: ${{ secrets.CI_BOT_TOKEN }} + RELEASE_ID: ${{ needs.release-draft.outputs.id }} + run: | + set -euo pipefail + gh variable set DRAFT_RELEASE_ID --body "$RELEASE_ID" --repo "${{ github.repository }}" diff --git a/.github/workflows/setup_labels.yml b/.github/workflows/setup_labels.yml new file mode 100644 index 0000000..a42fc2a --- /dev/null +++ b/.github/workflows/setup_labels.yml @@ -0,0 +1,24 @@ +# This file is generated from athackst/ci/template/.github/workflows/setup_labels.yml.jinja. +# Do not edit directly; update the template instead. + +name: Setup Labels + +on: + push: + branches: [main] + paths: + - ".github/ci-config.yml" + workflow_dispatch: + +jobs: + setup-labels: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Setup labels + id: setup-labels + uses: athackst/ci/actions/setup-labels@main + with: + github-token: ${{ secrets.CI_BOT_TOKEN || github.token }} + configuration-path: .github/ci-config.yml