-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.64 KB
/
release.yaml
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
59
60
61
name: release
on:
push:
branches:
- master
jobs:
release_helper:
runs-on: ubuntu-latest
outputs:
release: ${{ steps.release.outputs.release_created }}
major: ${{ steps.release.outputs.major }}
minor: ${{ steps.release.outputs.minor }}
patch: ${{ steps.release.outputs.patch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: python
pull-request-header: ":robot: New release version"
pull-request-title-pattern: "chore: release${component} ${version}"
release:
runs-on: ubuntu-latest
needs: release_helper
if: ${{ needs.release_helper.outputs.release }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare
id: prepare
run: |
echo "::set-output name=version::${{ needs.release_helper.outputs.major }}.${{ needs.release_helper.outputs.minor }}.${{ needs.release_helper.outputs.patch }}"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install
run: |
pip install setuptools wheel
pip install -r requirements.txt
- name: Update version
run: |
sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.prepare.outputs.version }}/g" setup.py
- name: Build wheel
run: |
python setup.py sdist bdist_wheel
- name: Publish 📦 to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.11
with:
password: ${{ secrets.PYPI_API_TOKEN }}