From 3ad4f0f2abdb36af6a62597e4fa8c15da6204442 Mon Sep 17 00:00:00 2001 From: KC Berg Date: Wed, 9 Jul 2025 05:05:27 -0600 Subject: [PATCH 1/4] ci: remove set-url and test GH_TOKEN steps for GITHUB_TOKEN-only workflow --- .github/workflows/ci.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f75128..d1445d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,7 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install . + pip install bumpver - name: Run tests run: | pytest --maxfail=1 --disable-warnings @@ -38,18 +39,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Test GH_TOKEN permissions - run: | - curl -v -H "Authorization: token ${{ secrets.GH_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }} - shell: bash - name: Set git user for hawkdeploy run: | - git config user.name "${{ secrets.GH_DEPLOY_USER }}" - git config user.email "${{ secrets.GH_DEPLOY_EMAIL }}" - - name: Set up git for pushing - run: | - git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - name: Show git user and remote run: | git config --get user.name @@ -82,11 +75,8 @@ jobs: fetch-depth: 0 - name: Set git user for hawkdeploy run: | - git config user.name "${{ secrets.GH_DEPLOY_USER }}" - git config user.email "${{ secrets.GH_DEPLOY_EMAIL }}" - - name: Set up git for pushing - run: | - git remote set-url origin https://${{ secrets.GH_DEPLOY_USER }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - name: Bump patch version with bumpver run: bumpver update --patch --commit - name: Push version bump commit From 6a9c3540572c7ddce551e85e3b84ab520aea3938 Mon Sep 17 00:00:00 2001 From: KC Berg Date: Wed, 9 Jul 2025 05:08:16 -0600 Subject: [PATCH 2/4] ci: install dependencies in bump-version job using requirements.txt and pip install . --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1445d2..7341724 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,6 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install . - pip install bumpver - name: Run tests run: | pytest --maxfail=1 --disable-warnings @@ -77,6 +76,11 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install . - name: Bump patch version with bumpver run: bumpver update --patch --commit - name: Push version bump commit From 018160f0251203bbe3b4198a66143cad174fa30a Mon Sep 17 00:00:00 2001 From: KC Berg Date: Wed, 9 Jul 2025 05:14:32 -0600 Subject: [PATCH 3/4] release: use workflow_dispatch for manual release trigger --- .github/workflows/release.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9845c78..525bf06 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,7 @@ name: Release on: - release: - types: [published] + workflow_dispatch: permissions: contents: write @@ -51,11 +50,7 @@ jobs: - name: Install build dependencies run: | python -m pip install --upgrade pip - pip install build bumpver - - name: Set up git for pushing - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + pip install build - name: Build package run: | python -m build @@ -72,10 +67,6 @@ jobs: with: ref: ${{ github.ref }} fetch-depth: 0 - - name: Set up git for pushing - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx From 99e466308ae7f7ee211f2c094d45d04fd7e24527 Mon Sep 17 00:00:00 2001 From: KC Berg Date: Wed, 9 Jul 2025 05:20:16 -0600 Subject: [PATCH 4/4] prepare-release: remove tag input, always bump minor from main --- .github/workflows/prepare-release.yml | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/prepare-release.yml diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 0000000..54eb786 --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,35 @@ +name: Prepare Release + +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + bump-minor-version: + name: Bump Minor Version + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install . + - name: Set git user for github-actions + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: Bump minor version with bumpver + run: bumpver update --minor --commit + - name: Push version bump commit + run: | + git push origin HEAD:main \ No newline at end of file