forked from tofuSCHNITZEL/pyopnsense
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.26 KB
/
publish.yml
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
name: Publish
on:
push:
branches:
- main
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, 'Update CHANGELOG.md')"
environment:
name: pypi
url: https://pypi.org/p/${{ vars.PACKAGE_NAME }}
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
# Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ vars.PYTHON_VERSION }}
# Install dependencies
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install -r test-requirements.txt
# Verify the version
- name: Verify version
run: hatch version
# Build packages
- name: Build package distributions
run: |
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: $${{ secrets.PYPI_PUBLISH_TOKEN }}