-
Notifications
You must be signed in to change notification settings - Fork 11
90 lines (74 loc) · 2 KB
/
automated_release.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
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
name: Automated Release
on:
release:
types: [published]
jobs:
test-again:
name: Test with pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
python -m pip install .
- name: Test with pytest
run: |
pytest
build-and-release:
runs-on: ubuntu-latest
permissions: write-all
needs: [test-again]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build
- name: Build wheel
run: |
python -m build --wheel
- name: Upload wheel to artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*.whl
# - name: Create GitHub Release
# uses: docker://antonyurchenko/git-release:v5
# # configurations
# # https://github.com/anton-yurchenko/git-release?tab=readme-ov-file#configuration
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# DRAFT_RELEASE: "false"
# PRE_RELEASE: "false"
# CHANGELOG_FILE: "CHANGELOG.md"
# with:
# args: |
# dist/*.whl
publish:
runs-on: ubuntu-latest
needs: [test-again]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install twine and build
run: python -m pip install --upgrade twine build
- name: Build
run: python -m build
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}