diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index fcca4ea..7c53960 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,31 +1,29 @@ -name-template: 'v$RESOLVED_VERSION 🌈' -tag-template: 'v$RESOLVED_VERSION' +name-template: "v$RESOLVED_VERSION 🌈" +tag-template: "v$RESOLVED_VERSION" categories: - - title: '🚀 Features' + - title: "🚀 Features" labels: - - 'feature' - - 'enhancement' - - title: '🐛 Bug Fixes' + - "feature" + - "enhancement" + - title: "🐛 Bug Fixes" labels: - - 'fix' - - 'bugfix' - - 'bug' - - title: '🧰 Maintenance' - label: 'chore' -change-template: '- $TITLE @$AUTHOR (#$NUMBER)' + - "fix" + - "bugfix" + - "bug" +change-template: "- $TITLE @$AUTHOR (#$NUMBER)" change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +version-template: "$MAJOR.$MINOR.$PATCH" version-resolver: major: labels: - - 'major' + - "major" minor: labels: - - 'minor' + - "minor" patch: labels: - - 'patch' + - "patch" default: patch template: | ## Changes - $CHANGES diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 863470c..94820be 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -10,6 +10,6 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v4.2.2 + - uses: actions/setup-python@v5.3.0 - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml index 182f452..ad3bc87 100644 --- a/.github/workflows/release-drafter.yaml +++ b/.github/workflows/release-drafter.yaml @@ -4,19 +4,39 @@ on: push: branches: - main - pull_request: - types: [opened, reopened, synchronize] - -permissions: - contents: read jobs: update_release_draft: + runs-on: ubuntu-latest permissions: contents: write pull-requests: write - runs-on: ubuntu-latest steps: - - uses: release-drafter/release-drafter@v6 + - name: Checkout + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + - uses: release-drafter/release-drafter@v6.0.0 + id: release-drafter + with: + config-name: release-drafter.yml + publish: false + prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: version + id: version + run: | + git pull --tags + echo ${{ steps.release-drafter.outputs.tag_name }} + tag=${{ steps.release-drafter.outputs.tag_name }} + version=${tag#v} + major=${version%%.*} + echo "tag=${tag}" >> $GITHUB_OUTPUT + echo "version=${version}" >> $GITHUB_OUTPUT + echo "major=${major}" >> $GITHUB_OUTPUT + + - name: force update major tag + run: | + git tag v${{ steps.version.outputs.major }} ${{ steps.version.outputs.tag }} -f + git push origin refs/tags/v${{ steps.version.outputs.major }} -f diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3af437c..bf3b95e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace