Repository navigation
96 lines (79 loc) · 2.49 KB
/
Copy pathdeploy.yml
File metadata and controls
96 lines (79 loc) · 2.49 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Build and deploy AtomPacker
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
name: Build sdist and wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install PyPA's build
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build
- name: Build distribution archives
run: |
python -m build --wheel --sdist .
- name: Upload distribution archives
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
./dist/*.whl
./dist/*.tar.gz
test-on-different-os:
name: Test on different on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: [build]
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: actions/download-artifact@v4
with:
name: artifacts
path: ./dist
- name: Test sdist on ${{ matrix.os }}
run: |
python -m pip install --upgrade pip
python -m pip install pytest
python -m pip install ./dist/atompacker-${{ github.event.release.tag_name }}.tar.gz
python -c 'import AtomPacker; print(AtomPacker.__version__)'
pytest tests --import-mode=importlib --verbose
- name: Test wheel on ${{ matrix.os }}
run: |
python -m pip install --upgrade pip
python -m pip install pytest
python -m pip install ./dist/atompacker-${{ github.event.release.tag_name }}-py3-none-any.whl
python -c 'import AtomPacker; print(AtomPacker.__version__)'
pytest tests --import-mode=importlib --verbose
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: [test-on-different-os]
environment:
name: pypi
url: https://pypi.org/project/AtomPacker
permissions:
id-token: write
steps:
- uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: actions/download-artifact@v4
with:
name: artifacts
path: ./dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}