-
Notifications
You must be signed in to change notification settings - Fork 0
264 lines (239 loc) · 8.62 KB
/
release.yml
File metadata and controls
264 lines (239 loc) · 8.62 KB
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
name: Release
on:
release:
types: [created]
jobs:
get-release:
runs-on: ubuntu-24.04-arm
steps:
- name: Get Release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Dump upload url to file
run: echo '${{ steps.get_release.outputs.upload_url }}' > upload_url
- name: Upload upload_url
uses: actions/upload-artifact@v4
with:
name: upload_url
path: upload_url
build:
needs: get-release
strategy:
matrix:
platform: [
'linux-arm64',
# 'linux-x64',
]
pair: [
# 'python:3.7',
# 'python:3.9',
'python:3.11',
'python:3.13',
]
include:
# - platform: 'linux-arm'
# host-os: 'ubuntu-latest'
- platform: 'linux-arm64'
host-os: 'ubuntu-24.04-arm'
# - platform: 'linux-x64'
# host-os: 'ubuntu-latest'
# - pair: 'python:3.7'
# language: 'python'
# version: '3.7'
# - pair: 'python:3.9'
# language: 'python'
# version: '3.9'
- pair: 'python:3.11'
language: 'python'
version: '3.11'
- pair: 'python:3.13'
language: 'python'
version: '3.13'
runs-on: ${{ matrix.host-os }}
steps:
- name: Download upload_url
uses: actions/download-artifact@v4
with:
name: upload_url
path: upload_url
- name: Set upload_url
run: echo "UPLOAD_URL=$(cat upload_url/upload_url)" >> $GITHUB_ENV
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Use Python ${{ matrix.version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
# - name: Make build script executable
# run: chmod +x ./build.sh
- name: Make packaging script executable
run: |
chmod +x ./package.sh
- name: Build addon
run: |
./package.sh "${{ matrix.platform }}" "${{ matrix.language }}" "${{ matrix.version }}"
shell: bash
- name: Upload Release Asset tgz
uses: shogo82148/actions-upload-release-asset@v1
with:
#upload_url: ${{ github.event.release.upload_url }}
upload_url: ${{ env.UPLOAD_URL }}
asset_path: bluetoothpairing-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz
overwrite: true
- name: Upload Release Asset shasum
uses: shogo82148/actions-upload-release-asset@v1
with:
#upload_url: ${{ github.event.release.upload_url }}
upload_url: ${{ env.UPLOAD_URL }}
asset_path: bluetoothpairing-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz.sha256sum
overwrite: true
#
# ATTEMPT TO ALSO BUILD 32 BIT VERSION
#
get-release_old:
runs-on: ubuntu-24.04
steps:
- name: Get Release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Dump upload url to file
run: echo '${{ steps.get_release.outputs.upload_url }}' > upload_url_old
- name: Upload upload_url_old
uses: actions/upload-artifact@v4
with:
name: upload_url_old
path: upload_url_old
build_job_old:
needs: get-release
# The host should always be linux
runs-on: ubuntu-24.04
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
# Run steps on a matrix of arch/distro combinations
strategy:
matrix:
arch: [armv7]
version: ['3.11']
include:
- distro: bookworm
- arch: armv7
platform: linux-arm
steps:
- name: Download upload_url_old
uses: actions/download-artifact@v4
with:
name: upload_url_old
path: upload_url_old
- name: Display upload_url folder contents
run: ls -lah upload_url_old
- name: Set upload_url
run: echo "UPLOAD_URL_OLD=$(cat upload_url_old/upload_url_old)" >> $GITHUB_ENV
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
path: './build'
#- name: Make packaging script executable
# run: |
# chmod +x ./package.sh
- uses: uraimo/run-on-arch-action@v3
name: Build artifact
id: build_it
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
#version: ${{ matrix.version }}
# Not required, but speeds up builds
# githubToken: ${{ github.token }}
# Create a build directory
setup: |
echo "github workspace: $GITHUB_WORKSPACE/"
pwd
mkdir -p "${PWD}/build"
#echo "build folder created?"
echo "PWD: ${PWD}"
ls
# Mount the build directory as /build in the container
dockerRunArgs: |
--volume "${PWD}/build:/build"
# Pass some environment variables to the container
env: | # YAML, but pipe character is necessary
artifact_name: git-${{ matrix.distro }}_${{ matrix.arch }}
# The shell to run commands within the container
shell: /bin/bash
# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
install: |
case "${{ matrix.distro }}" in
ubuntu*|jessie|stretch|buster|bullseye|bookworm|trixie)
apt-get update -q -y
apt-get install -q -y git
apt-get install -q -y "python${{ matrix.version }}" python3-pip
#apt-get install -q -y libjpeg-dev zlib1g-dev libpng-dev
alias python="python${{ matrix.version }}"
alias python3="python${{ matrix.version }}"
echo "___ PWD: $PWD ___"
echo "=== matrix.version: ${{ matrix.version }}"
ls -al "${PWD}"
echo "___ package.sh? ___"
find / -name package.sh
#echo "___ build folder? ___"
#find / -name build
;;
fedora*)
dnf -y update
dnf -y install git which
ls -al "${PWD}"
;;
alpine*)
apk update
apk add git
ls -al "${PWD}"
#python3 --version
;;
esac
# Produce a binary artifact and place it in the mounted volume
#run: |
# cp $(which git) "/build/${artifact_name}"
# echo "Produced artifact at /build/${artifact_name}"
run: |
cd build
ls
echo "Python version from workflow matrix: ${{ matrix.version }}"
chmod +x package.sh
export PYTHON_VERSION="${{ matrix.version }}"
echo "PYTHON_VERSION: $PYTHON_VERSION"
ADDON_ARCH="${{ matrix.platform }}" ./package.sh "${{ matrix.platform }}" "${{ matrix.language }}" "${{ matrix.version }}"
ls -lh
cp bluetoothpairing* ..
#- name: Show the artifact
# Items placed in /build in the container will be in
# ${PWD}/build on the host.
# run: |
# ls -al "${PWD}"
#- name: List after container
# run: |
# ls -lh
# shell: bash
- name: Upload Release Asset tgz
uses: shogo82148/actions-upload-release-asset@v1
with:
#upload_url: ${{ github.event.release.upload_url }}
upload_url: ${{ env.UPLOAD_URL_OLD }}
asset_path: bluetoothpairing-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz
overwrite: true
- name: Upload Release Asset shasum
uses: shogo82148/actions-upload-release-asset@v1
with:
#upload_url: ${{ github.event.release.upload_url }}
upload_url: ${{ env.UPLOAD_URL_OLD }}
asset_path: bluetoothpairing-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz.sha256sum
overwrite: true