-
Notifications
You must be signed in to change notification settings - Fork 14
113 lines (96 loc) · 3.04 KB
/
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Release
on:
pull_request:
types:
- closed
branches:
- devel
jobs:
release:
if: ${{ github.event.pull_request.merged == true && contains(github.head_ref, 'release') }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- name: Checkout latest version
uses: actions/checkout@v3
with:
ref: devel
- name: Setup Python, Ubuntu and Python environment
uses: ./.github/workflows/actions/setup
with:
python-version: ${{ matrix.python-version }}
- name: Install Perun (to assure it is correctly installed) and try obtaining the version
run: |
make install
perun --version
- name: Set version
id: manual-tagger
run: echo "NEW_TAG=$(perun --version | cut -d' ' -f2)" >> "$GITHUB_OUTPUT"
- name: Tag the new version
uses: rickstaa/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.manual-tagger.outputs.NEW_TAG }}
build-and-deploy-doc:
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- name: Checkout latest version
uses: actions/checkout@v3
with:
ref: devel
- name: Setup Python, Ubuntu and Python environment
uses: ./.github/workflows/actions/setup
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Generate docs for Python using Tox
run: |
tox -e docs
- name: Deploy to GH pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/_build/html
build-and-deploy-to-pypi:
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- name: Checkout latest version
uses: actions/checkout@v4
with:
ref: devel
- name: Setup Python, Ubuntu and Python environment
uses: ./.github/workflows/actions/setup
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Ensure that dependencies are installed
run: |
# Install and upgrade pip
python3 -m pip install --upgrade pip
# Install dependencies for build and deploy
python3 -m pip install build wheel twine
- name: Build python release distribution package
run: |
make release
- name: Upload to TestPypi
run: |
python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI_SECRET_TOKEN }}
TWINE_REPOSITORY: testpypi
- name: Upload to Pypi
run: |
python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_SECRET_TOKEN }}