-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (54 loc) · 1.7 KB
/
Copy pathpublish.yml
File metadata and controls
59 lines (54 loc) · 1.7 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
name: Upload Python Package to PyPI when a Release is Created
on:
release:
types: [created]
workflow_dispatch:
jobs:
call-validate-local:
name: Call Test Python Code with Local Libraries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check local files
run: |
ls -a
- name: Call action to validate local code
uses: ./.github/workflows/validate-local/
call-validate-wheel:
name: Call Test Python Code to Build Wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check local files
run: |
ls -a
- name: Call action to validate wheel
uses: ./.github/workflows/validate-wheel/
pypi-publish:
needs: [ call-validate-local, call-validate-wheel ]
name: Publish release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/python-vor
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies and build package
run: |
python -m venv venv
source ./venv/bin/activate
pip install --upgrade pip
pip install setuptools wheel build
pip install -r src/python_vor/requirements.txt
sed -i 's/version = "v0.0.0"/version = "${{ steps.get-latest-tag.outputs.tag }}"/' ./pyproject.toml
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1