Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,30 @@ jobs:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Check for bumpver commit
id: skip_bumpver
run: |
if [[ "${{ github.event.head_commit.message }}" == *"bump: version"* ]]; then
echo "Bumpver commit detected, skipping job."
exit 0
fi
- uses: actions/checkout@v4
if: steps.skip_bumpver.outcome == 'success'
with:
persist-credentials: 'false'
- name: Set up Python ${{ matrix.python-version }}
if: steps.skip_bumpver.outcome == 'success'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: steps.skip_bumpver.outcome == 'success'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .
- name: Run tests
if: steps.skip_bumpver.outcome == 'success'
run: |
pytest --maxfail=1 --disable-warnings

Expand All @@ -34,29 +45,42 @@ jobs:
needs: test
runs-on: ubuntu-latest
steps:
- name: Check for bumpver commit
id: skip_bumpver
run: |
if [[ "${{ github.event.head_commit.message }}" == *"bump: version"* ]]; then
echo "Bumpver commit detected, skipping job."
exit 0
fi
- uses: actions/checkout@v4
if: steps.skip_bumpver.outcome == 'success'
with:
persist-credentials: 'false'
- name: Generate GitHub App token
if: steps.skip_bumpver.outcome == 'success'
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.HAWKY_APP_ID }}
private_key: ${{ secrets.HAWKY_APP_PRIVATE_KEY }}
- name: Set up git for pushing
if: steps.skip_bumpver.outcome == 'success'
run: |
git remote set-url origin https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/${{ github.repository }}.git
- name: Show current branch and HEAD
if: steps.skip_bumpver.outcome == 'success'
run: |
git branch -a
git status
git rev-parse --abbrev-ref HEAD
- name: Get version from pyproject.toml
if: steps.skip_bumpver.outcome == 'success'
id: get_version
run: |
VERSION=$(grep '^version =' pyproject.toml | head -1 | cut -d '"' -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create and push tag for current version (with verbose logging)
if: steps.skip_bumpver.outcome == 'success'
run: |
git remote -v
git tag v${{ steps.get_version.outputs.version }}
Expand All @@ -68,29 +92,43 @@ jobs:
needs: [test, tag-version]
runs-on: ubuntu-latest
steps:
- name: Check for bumpver commit
id: skip_bumpver
run: |
if [[ "${{ github.event.head_commit.message }}" == *"bump: version"* ]]; then
echo "Bumpver commit detected, skipping job."
exit 0
fi
- uses: actions/checkout@v4
if: steps.skip_bumpver.outcome == 'success'
with:
persist-credentials: 'false'
- name: Generate GitHub App token
if: steps.skip_bumpver.outcome == 'success'
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.HAWKY_APP_ID }}
private_key: ${{ secrets.HAWKY_APP_PRIVATE_KEY }}
- name: Set up git for pushing
if: steps.skip_bumpver.outcome == 'success'
run: |
git remote set-url origin https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/${{ github.repository }}.git
- name: Install dependencies
if: steps.skip_bumpver.outcome == 'success'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .
- name: Set git user for HawkyMcBuilderFace bot
if: steps.skip_bumpver.outcome == 'success'
run: |
git config user.name "HawkyMcBuilderFace[bot]"
git config user.email "hawkymcbuilderface[bot]@users.noreply.github.com"
- name: Bump patch version with bumpver
if: steps.skip_bumpver.outcome == 'success'
run: bumpver update --patch --commit
- name: Push version bump commit
if: steps.skip_bumpver.outcome == 'success'
run: |
git push
18 changes: 17 additions & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,50 @@ jobs:
name: Bump Minor Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for bumpver commit
id: skip_bumpver
run: |
if [[ "${{ github.event.head_commit.message }}" == *"bump: version"* ]]; then
echo "Bumpver commit detected, skipping job."
exit 0
fi
- name: Checkout code
if: steps.skip_bumpver.outcome == 'success'
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Set up Python
if: steps.skip_bumpver.outcome == 'success'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
if: steps.skip_bumpver.outcome == 'success'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .
- name: Generate GitHub App token
if: steps.skip_bumpver.outcome == 'success'
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.HAWKY_APP_ID }}
private_key: ${{ secrets.HAWKY_APP_PRIVATE_KEY }}
- name: Set up git for pushing
if: steps.skip_bumpver.outcome == 'success'
run: |
git remote set-url origin https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/${{ github.repository }}.git
- name: Set git user for HawkyMcBuilderFace bot
if: steps.skip_bumpver.outcome == 'success'
run: |
git config user.name "HawkyMcBuilderFace[bot]"
git config user.email "hawkymcbuilderface[bot]@users.noreply.github.com"
- name: Bump minor version with bumpver
if: steps.skip_bumpver.outcome == 'success'
run: bumpver update --minor --commit
- name: Push version bump commit
if: steps.skip_bumpver.outcome == 'success'
run: |
git push origin HEAD:main