-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (53 loc) · 1.54 KB
/
packaging.yml
File metadata and controls
66 lines (53 loc) · 1.54 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
name: Packaging
on:
- push
jobs:
build_source_dist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build
run: python -m pip install build
- name: Run build
run: python -m build --sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
publish:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install pypa/build
run: python -m pip install build
- name: Build distribution
run: python -m build --outdir dist/
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
attestations: false
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: false
- name: Publish distribution to GitHub release
uses: softprops/action-gh-release@v2
with:
files: |
dist/minimal-pba-cli-*.whl
dist/minimal_pba_cli-*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}