-
Notifications
You must be signed in to change notification settings - Fork 13
189 lines (161 loc) · 5.01 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Release
permissions: write-all
on:
pull_request:
types:
- closed
branches:
- devel
jobs:
release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout latest version
uses: actions/checkout@v3
with:
ref: devel
- name: Set up git config
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Infer the new version (without tagging)
id: tagger
uses: phish108/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
release-branch: devel
bump: minor
dry-run: 'TRUE'
- name: Set the new version to file (without commit; will serve as temporary file)
run: |
echo "${{ steps.tagger.outputs.new-tag }}" > VERSION
- name: Tag the new version
uses: phish108/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
release-branch: devel
bump: minor
build-and-deploy-doc:
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
make -C doc init
- name: Compile the documentation
run: |
python -m pip install --upgrade pip
make -C doc html
- name: Deploy to gh pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: doc/_build/html
build-and-deploy-to-pypi:
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v3
- name: Infer the new version (without tagging)
id: tagger
uses: phish108/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
release-branch: devel
bump: minor
dry-run: 'TRUE'
- name: Set the new version to file without commiting (since the GA is done wrt old version)
run: |
echo "${{ steps.tagger.outputs.new-tag }}" > VERSION
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Python Dependencies
run: |
# Install and upgrade pip
python3 -m pip install --upgrade pip
# Install dependencies for build and deploy
python3 -m pip install setuptools wheel twine
- name: Install Python Dependencies
run: |
make -C bindings/python init
- name: Install Unix dependencies
run: |
sudo apt-get -qq update
sudo apt-get -qq install -y graphviz graphviz-dev
- name: Verify that the Binding can be installed
run: |
make -C bindings/python install
- name: Verify tests tests
run: |
make -C bindings/python test
- name: Build python release distribution package
run: |
make -C bindings/python pypi-release
- name: Upload to TestPypi
run: |
python3 -m twine upload bindings/python/dist/*.tar.gz
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI_SECRET_TOKEN }}
TWINE_REPOSITORY: testpypi
- name: Upload to Pypi
run: |
python3 -m twine upload bindings/python/dist/*.tar.gz
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_SECRET_TOKEN }}
warnings:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/setup
with:
os: ${{ matrix.os }}
- uses: ./.github/workflows/actions/compile
with:
build-log-output-file: 'warnings-release'
- name: Print release warnings
run: cat build_log
- name: Count number of warnings
run: |
number_of_warnings=`cat build_log | grep "warning:" | wc -l`
echo $number_of_warnings
if [ $number_of_warnings -gt 0 ]; then
exit 1
fi
run-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/setup
with:
os: ${{ matrix.os }}
- uses: ./.github/workflows/actions/compile
with:
build-log-output-file: 'warnings-new'
- name: Test the library
run: make test