Skip to content

Commit 91e1986

Browse files
committed
ci: add dev branch auto-publish to release workflow
Add dev branch to push trigger with dev-specific version bumping (hatch version dev) and loop prevention ([skip ci] + actor guard). Dev pushes publish to PyPI without creating GitHub Releases. Main branch behavior preserved via job-level condition.
1 parent 1292386 commit 91e1986

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,39 @@ on:
44
push:
55
branches:
66
- main
7-
paths:
8-
- cumulusci/__about__.py
7+
- dev
98

109
concurrency: publishing
1110

1211
jobs:
1312
publish-to-pypi:
1413
name: Publish new release to PyPI
1514
runs-on: SFDO-Tooling-Ubuntu
15+
if: >-
16+
(github.ref_name == 'main' && contains(github.event.head_commit.modified, 'cumulusci/__about__.py'))
17+
|| (github.ref_name == 'dev' && github.actor != 'github-actions[bot]')
1618
steps:
1719
- uses: actions/checkout@v4
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
1822
- name: Set up Python 3.13
1923
uses: actions/setup-python@v5
2024
with:
2125
python-version: 3.13
2226
cache: pip
2327
- name: Install build tools
2428
run: python -m pip install hatch tomli tomli-w
29+
- name: Bump dev version
30+
if: github.ref_name == 'dev'
31+
run: hatch version dev
32+
- name: Commit and push dev version bump
33+
if: github.ref_name == 'dev'
34+
run: |
35+
git config user.name "github-actions[bot]"
36+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
37+
git add cumulusci/__about__.py
38+
git commit -m "Bump dev version [skip ci]"
39+
git push
2540
- name: Build source tarball and binary wheel
2641
run: hatch build -c
2742
- name: Upload to PyPI
@@ -30,6 +45,7 @@ jobs:
3045
HATCH_INDEX_USER: "__token__"
3146
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
3247
- name: Create release
48+
if: github.ref_name == 'main'
3349
env:
3450
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3551
run: |

0 commit comments

Comments
 (0)