-
Notifications
You must be signed in to change notification settings - Fork 254
58 lines (55 loc) · 2.14 KB
/
release.yml
File metadata and controls
58 lines (55 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Publish and release CumulusCI
on:
push:
branches:
- main
- dev
concurrency: publishing
jobs:
publish-to-pypi:
name: Publish new release to PyPI
runs-on: SFDO-Tooling-Ubuntu
if: >-
(github.ref_name == 'main' && contains(github.event.head_commit.modified, 'cumulusci/__about__.py'))
|| (github.ref_name == 'dev' && github.actor != 'github-actions[bot]')
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.13
cache: pip
- name: Install build tools
run: python -m pip install hatch tomli tomli-w
- name: Bump dev version
if: github.ref_name == 'dev'
run: hatch version dev
- name: Commit and push dev version bump
if: github.ref_name == 'dev'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add cumulusci/__about__.py
git commit -m "Bump dev version [skip ci]"
git push
- name: Build source tarball and binary wheel
run: hatch build -c
- name: Upload to PyPI
run: hatch publish
env:
HATCH_INDEX_USER: "__token__"
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
- name: Create release
if: github.ref_name == 'main'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="$(hatch version)"
awk '/<!-- latest-start -->/,/<!-- latest-stop -->/' docs/history.md > changelog.md
gh release create "v$VERSION" \
dist/*.whl \
dist/*.tar.gz \
--notes-file changelog.md \
--title $VERSION