From ae6b22fac7f4cb9cdcd42682df198c00a0d8f54e Mon Sep 17 00:00:00 2001 From: "liblaf[bot]" <184555210+liblaf[bot]@users.noreply.github.com> Date: Sun, 2 Nov 2025 18:56:47 +0000 Subject: [PATCH] chore(copier): update from template --- .config/copier/.copier-answers.python.yaml | 2 +- .config/copier/.copier-answers.release.yaml | 2 +- .config/copier/.copier-answers.shared.yaml | 2 +- .config/release-please/config.json | 1 - .github/workflows/mega-linter.yaml | 37 ++---- .github/workflows/release-please.yaml | 134 ++++++++++++++++++++ .pre-commit-config.yaml | 4 +- 7 files changed, 151 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/release-please.yaml diff --git a/.config/copier/.copier-answers.python.yaml b/.config/copier/.copier-answers.python.yaml index 506da7302..3627fa2c1 100644 --- a/.config/copier/.copier-answers.python.yaml +++ b/.config/copier/.copier-answers.python.yaml @@ -1,7 +1,7 @@ # This file is @generated by . # DO NOT EDIT! # prettier-ignore -_commit: 5602f9a +_commit: f7444d2 _src_path: gh:liblaf/copier-python answers_file_shared: .config/copier/.copier-answers.shared.yaml namespace: liblaf diff --git a/.config/copier/.copier-answers.release.yaml b/.config/copier/.copier-answers.release.yaml index 5c7e41747..ca3e43998 100644 --- a/.config/copier/.copier-answers.release.yaml +++ b/.config/copier/.copier-answers.release.yaml @@ -1,6 +1,6 @@ # This file is @generated by . # DO NOT EDIT! # prettier-ignore -_commit: 3b1f285 +_commit: e5a3dcc _src_path: gh:liblaf/copier-release release_type: python diff --git a/.config/copier/.copier-answers.shared.yaml b/.config/copier/.copier-answers.shared.yaml index 4fcdd7b81..b4c688f7b 100644 --- a/.config/copier/.copier-answers.shared.yaml +++ b/.config/copier/.copier-answers.shared.yaml @@ -1,7 +1,7 @@ # This file is @generated by . # DO NOT EDIT! # prettier-ignore -_commit: 610df18 +_commit: 1aa0c04 _src_path: gh:liblaf/copier-shared author_email: 30631553+liblaf@users.noreply.github.com author_name: liblaf diff --git a/.config/release-please/config.json b/.config/release-please/config.json index 65a7649ec..41468a06d 100644 --- a/.config/release-please/config.json +++ b/.config/release-please/config.json @@ -50,7 +50,6 @@ "section": "⏪️ Reverts" } ], - "extra-label": "automerge", "include-component-in-tag": false, "always-update": true, "initial-version": "0.1.0", diff --git a/.github/workflows/mega-linter.yaml b/.github/workflows/mega-linter.yaml index 983004d2d..ff76cf833 100644 --- a/.github/workflows/mega-linter.yaml +++ b/.github/workflows/mega-linter.yaml @@ -8,45 +8,34 @@ name: MegaLinter on: push: - pull_request: workflow_dispatch: jobs: - skip-duplicate: - name: Skip Duplicate - permissions: - actions: write - runs-on: ubuntu-latest - outputs: - should-skip: ${{ steps.skip-duplicate.outputs.should-skip }} - steps: - - id: skip-duplicate - name: Skip Duplicate - uses: liblaf/actions/skip-duplicate@dist - with: - cancel-others: true - mega-linter: name: MegaLinter permissions: contents: write - issues: write pull-requests: write - needs: - - skip-duplicate - if: needs.skip-duplicate.outputs.should-skip != 'true' + environment: + name: MegaLinter runs-on: ubuntu-latest steps: + - id: auth + name: Auth + uses: liblaf/actions/auth@dist + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} - name: Checkout uses: actions/checkout@v5 - with: - ref: ${{ github.head_ref || github.ref }} - id: lint name: MegaLinter uses: liblaf/actions/mega-linter@dist + with: + token: ${{ steps.auth.outputs.token }} - if: success() || failure() name: Upload Reports - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: mega-linter-reports path: |- @@ -67,9 +56,7 @@ jobs: sign-commits: true title: "chore(mega-linter): apply linters automatic fixes" body-path: ${{ runner.temp }}/megalinter-report.md - labels: |- - autofix - automerge + labels: auto,automerge assignees: ${{ github.repository_owner }} reviewers: ${{ github.repository_owner }} - if: steps.lint.outputs.has-updated-sources > 0 && github.ref != 'refs/heads/main' diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 000000000..691250379 --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,134 @@ +# This file is @generated by . +# DO NOT EDIT! + +name: Release Please + +on: + push: + branches: + - main + +jobs: + release-please: + name: Release Please + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + environment: + name: Release Please + outputs: + pr: ${{ steps.release-please.outputs.pr }} + prs_created: ${{ steps.release-please.outputs.prs_created }} + release_created: ${{ steps.release-please.outputs.release_created }} + tag: ${{ steps.release-please.outputs.tag_name }} + steps: + - id: auth + name: Auth + uses: liblaf/actions/auth@dist + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + - name: Checkout + uses: actions/checkout@v5 + with: + token: ${{ steps.auth.outputs.token }} + - id: release-please + name: Release Please + uses: googleapis/release-please-action@v4 + with: + token: ${{ steps.auth.outputs.token }} + config-file: .config/release-please/config.json + manifest-file: .config/release-please/.manifest.json + + post-pr: + name: Post PR + permissions: + contents: write + pull-requests: write + needs: + - release-please + if: ${{ needs.release-please.outputs.pr }} + runs-on: ubuntu-latest + environment: + name: Release Please + steps: + - id: auth + name: Auth + uses: liblaf/actions/auth@dist + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + - name: Checkout + uses: actions/checkout@v5 + with: + ref: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }} + token: ${{ steps.auth.outputs.token }} + fetch-depth: 0 + - id: tag + name: Get Tag + run: |- + title='${{ fromJson(needs.release-please.outputs.pr).title }}' + version="$(awk '{ print $NF }' <<< "$title")" + printf 'tag=%s\n' "v$version" >> "$GITHUB_OUTPUT" + - name: Changelog + uses: liblaf/actions/changelog@dist + with: + output: CHANGELOG.md + args: --tag '${{ steps.tag.outputs.tag }}' + - id: message + name: Get Commit Message + run: |- + delimiter="$(uuidgen)" + message="$(git show --format='%B' --no-patch)" + printf 'message<<%s\n%s\n%s\n' "$delimiter" "$message" "$delimiter" >> "$GITHUB_OUTPUT" + - name: Undo Last Commit + run: git reset --soft HEAD~1 + - name: Commit + uses: liblaf/actions/commit@dist + with: + add-options: --verbose 'CHANGELOG.md' + force: true + message: ${{ steps.message.outputs.message }} + ref: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }} + token: ${{ steps.auth.outputs.token }} + - name: Add Label + run: |- + gh pr edit '${{ fromJson(needs.release-please.outputs.pr).number }}' --add-label 'automerge' + env: + GH_TOKEN: ${{ steps.auth.outputs.token }} + + post-release: + name: Post Release + permissions: + contents: write + needs: + - release-please + if: ${{ needs.release-please.outputs.release_created }} + runs-on: ubuntu-latest + environment: + name: Release Please + steps: + - id: auth + name: Auth + uses: liblaf/actions/auth@dist + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + - name: Checkout + uses: actions/checkout@v5 + with: + ref: ${{ needs.release-please.outputs.tag }} + token: ${{ steps.auth.outputs.token }} + fetch-depth: 0 + - id: changelog + name: Changelog + uses: liblaf/actions/changelog@dist + with: + args: --current --strip all + - name: Update Release Notes + run: >- + gh release edit '${{ needs.release-please.outputs.tag }}' + --notes-file '${{ steps.changelog.outputs.changelog }}' + env: + GH_TOKEN: ${{ steps.auth.outputs.token }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d06e7c06..344be9c7c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,14 +19,14 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.1 + rev: v0.14.2 hooks: - id: ruff-check args: - --fix - id: ruff-format - repo: https://github.com/biomejs/pre-commit - rev: v2.2.6 + rev: v2.3.1 hooks: - id: biome-check exclude: \.jsonc?$