-
Notifications
You must be signed in to change notification settings - Fork 770
54 lines (45 loc) · 1.2 KB
/
deploy.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
52
53
54
name: deploy
on:
# Trigger this workflow when the "main" workflow has completed successfully
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_run
workflow_run:
workflows:
- main
branches:
- master
types:
- completed
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build_wheels:
name: Build & Upload
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
- name: Upgrade pip
run: |
python3 -m pip install --upgrade pip
- name: Install build
run:
pip3 install --upgrade build
- name: Build wheel & sdist
run: |
python3 -m build --wheel --sdist
- uses: actions/upload-artifact@v3
with:
name: built-packages
path: |
./dist/*.whl
./dist/*.tar.gz
- name: Publish to Pypi
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}