-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.27 KB
/
python-publish.yaml
File metadata and controls
54 lines (44 loc) · 1.27 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
name: Publish Python packages to PyPI
on:
release:
types: [published]
jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # required for setuptools_scm to determine version from git tags
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install build
run: python -m pip install build
- name: Build package
run: |
cd packages/python/openproblems
python -m build
- name: Upload distribution artifacts
uses: actions/upload-artifact@v7
with:
name: python-package-distributions
path: packages/python/openproblems/dist/
publish-to-pypi:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/openproblems
permissions:
id-token: write # required for OIDC trusted publishing
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v8
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1