-
Notifications
You must be signed in to change notification settings - Fork 0
241 lines (201 loc) · 6.09 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: Release
on:
push:
# release on tag push
tags:
- '*'
permissions:
contents: write
jobs:
wheels:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
PYTHONIOENCODING: utf-8
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
python-version: [3.9, '3.10', '3.12']
steps:
- name: Set git crlf/eol
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deps for system pkgs
run: |
sudo apt-get -qq update
sudo apt-get install -yqq python3-gi python3-gi-cairo gir1.2-gtk-3.0
sudo apt-get install -yqq libgirepository1.0-dev libappindicator3-dev
sudo apt-get install -yqq software-properties-common
sudo add-apt-repository -y -s ppa:nerdboy/embedded
sudo apt-get -qq update
sudo apt-get install -yqq timew-report
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install tox tox-gh-actions
- name: Build dist pkgs
run: |
tox -e build
- name: Upload artifacts
if: matrix.python-version == 3.9 && runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: packages
path: dist
get_version:
name: Get version info
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
outputs:
version: ${{ steps.git_ver.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get package version
id: git_ver
run: |
version=$(git describe --tags | sed -e "s|-g|+g|")
echo "Version from git: ${version}"
echo "version=${version}" >> $GITHUB_OUTPUT
build_debs:
name: ${{ matrix.name }}
runs-on: ubuntu-22.04
needs: [get_version]
strategy:
fail-fast: false
matrix:
name: [
x64_bookworm,
x64_trixie,
x64_sid,
]
include:
- name: x64_bookworm
dist: bookworm
- name: x64_trixie
dist: trixie
- name: x64_sid
dist: sid
steps:
- name: Check github variables
env:
VERSION: ${{ needs.get_version.outputs.version }}
run: |
echo "Package version from git: ${VERSION}"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch debian files
run: |
wget https://launchpad.net/~nerdboy/+archive/ubuntu/embedded/+sourcefiles/timew-addons/0.1.1-1ubuntu1.22.04.1/timew-addons_0.1.1-1ubuntu1.22.04.1.debian.tar.xz
tar xf timew-addons_0.1.1-1ubuntu1.22.04.1.debian.tar.xz && rm *debian.tar.xz
ls
- name: Install deps and update debian changelog
run: |
sudo apt-get update
sudo apt-get install devscripts
debchange -v ${{ needs.get_version.outputs.version }}-${{ matrix.dist }} -b -M --distribution ${{ matrix.dist }} "ci build"
- name: Build deb packages
uses: jtdor/build-deb-action@v1
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
docker-image: "debian:${{ matrix.dist }}-slim"
buildpackage-opts: --build=binary --no-sign
extra-build-deps: git
- name: Upload deb files
uses: actions/upload-artifact@v4
with:
name: "timew-addons_${{ needs.get_version.outputs.version }}-${{ matrix.dist }}"
path: ./debian/artifacts/*.deb
create_release:
name: Create Release
needs: [build_debs, wheels]
runs-on: ubuntu-22.04
steps:
- name: Get version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo ${{ env.VERSION }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
# download all artifacts to project dir
- uses: actions/download-artifact@v4
- name: check artifacts
run: |
ls -l packages/
- name: Generate changes file
uses: sarnold/gitchangelog-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
name: Release v${{ env.VERSION }}
body_path: CHANGES.md
draft: false
prerelease: false
files: |
packages/timew*
docs:
name: Release docs
needs: [create_release]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# sphinx really does need the GObject package deps
- name: Deps for system pkgs
run: |
sudo apt-get -qq update
sudo apt-get install -yqq python3-gi python3-gi-cairo gir1.2-gtk-3.0
sudo apt-get install -yqq libgirepository1.0-dev libappindicator3-dev
sudo apt-get install -yqq software-properties-common
sudo add-apt-repository -y -s ppa:nerdboy/embedded
sudo apt-get -qq update
sudo apt-get install -yqq timew-report
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Add python requirements
run: |
python -m pip install --upgrade pip
pip install tox
- name: Build docs
run: |
tox -e ldocs,docs
- uses: actions/upload-artifact@v4
with:
name: ApiDocsHTML
path: "docs/_build/html/"
- name: set nojekyll for github
run: |
sudo touch docs/_build/html/.nojekyll
- name: Deploy docs to gh-pages
if: ${{ github.event_name == 'push' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/_build/html/
single-commit: true