-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (67 loc) · 2.18 KB
/
python_release.yml
File metadata and controls
72 lines (67 loc) · 2.18 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
59
60
61
62
63
64
65
66
67
68
69
70
71
# Python module release management
name: Release Management
on:
workflow_call:
env:
# Python language version to use.
PYTHON_VERSION: '3.10'
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release_please.outputs.release_created }}
steps:
- name: DevOpsArrBOT token
id: DevOpsArrBOT
uses: getsentry/action-github-app-token@v3
with:
app_id: '305652'
private_key: ${{ secrets.DEVOPSARRBOT_PRIVATE_KEY }}
- name: app name
id: app-name
run: |
app=${{ github.repository }} &&\
echo "name=$(echo $app | sed -e 's%.*/%%g' -e 's%-.*%%g')" >> $GITHUB_OUTPUT
- uses: actions/checkout@v6
with:
# Allow relase please to access older tag information.
fetch-depth: 0
token: ${{ steps.DevOpsArrBOT.outputs.token }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Release Please
id: release_please
uses: google-github-actions/release-please-action@v3
with:
release-type: python
token: ${{ steps.DevOpsArrBOT.outputs.token }}
extra-files: |
README.md
pyproject.toml
setup.py
${{ steps.app-name.outputs.name }}/__init__.py
${{ steps.app-name.outputs.name }}/configuration.py
${{ steps.app-name.outputs.name }}/api_client.py
pypi-release:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build requests pydantic
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}