-
Notifications
You must be signed in to change notification settings - Fork 20
55 lines (44 loc) · 1.2 KB
/
release.yaml
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
name: Release to PyPI and GitHub
on:
push:
tags:
- 'v*' # Push events with tags 'v*', i.e. 'v1.0.4' or 'v0.3.2'
jobs:
deploy-with-twine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
src
pyproject.toml
requirements.txt
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.10
cache: "pip"
- name: Install dependencies (with Twine)
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install twine
- name: Build dist
run: |
python -m build
- name: Test dist
run: |
python -m twine check dist/*
- name: Deploy dist
run: |
python -m twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
release-on-github:
needs: deploy-with-twine
name: Trigger GitHub release workflow
uses: ./.github/workflows/release-on-github.yaml
with:
tag: ${{ github.ref_name }}