diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 0d0b1c9..67f4c57 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1 +1,17 @@ +# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter _extends: .github + +# Override the template to include default tool versions +template: | + + + ## Default Clang Tools Versions for this release + + - **clang-format**: `$CLANG_FORMAT_VERSION` + - **clang-tidy**: `$CLANG_TIDY_VERSION` + + You can override the default versions by adding the `--version` argument under `args` in your pre-commit configuration. For details, see [Custom Clang Tool Version](https://github.com/cpp-linter/cpp-linter-hooks?tab=readme-ov-file#custom-clang-tool-version) + + $CHANGES + + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 2250d38..58cf6b1 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -8,4 +8,42 @@ on: jobs: draft-release: - uses: cpp-linter/.github/.github/workflows/release-drafter.yml@main + permissions: + # write permission is required to create a github release + contents: write + # write permission is required for autolabeler + # otherwise, read permission is required at least + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - name: Set up Python + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + with: + python-version: "3.12" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e . + + - name: Extract default tool versions + id: versions + run: | + CLANG_FORMAT_VERSION=$(python -c "from cpp_linter_hooks.util import DEFAULT_CLANG_FORMAT_VERSION; print(DEFAULT_CLANG_FORMAT_VERSION)") + CLANG_TIDY_VERSION=$(python -c "from cpp_linter_hooks.util import DEFAULT_CLANG_TIDY_VERSION; print(DEFAULT_CLANG_TIDY_VERSION)") + echo "CLANG_FORMAT_VERSION=$CLANG_FORMAT_VERSION" >> $GITHUB_OUTPUT + echo "CLANG_TIDY_VERSION=$CLANG_TIDY_VERSION" >> $GITHUB_OUTPUT + echo "Default clang-format version: $CLANG_FORMAT_VERSION" + echo "Default clang-tidy version: $CLANG_TIDY_VERSION" + + # Draft your next Release notes as Pull Requests are merged into the default branch + - uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0 + with: + commitish: 'main' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CLANG_FORMAT_VERSION: ${{ steps.versions.outputs.CLANG_FORMAT_VERSION }} + CLANG_TIDY_VERSION: ${{ steps.versions.outputs.CLANG_TIDY_VERSION }}