-
Notifications
You must be signed in to change notification settings - Fork 23
116 lines (103 loc) · 3.13 KB
/
Copy pathbuild.yml
File metadata and controls
116 lines (103 loc) · 3.13 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
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to build (leave empty for default branch)'
type: string
default: ''
workflow_call:
inputs:
branch:
type: string
default: ''
push:
branches:
- develop
jobs:
build_wheel:
name: Build wheel
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v6
with:
ref: ${{ inputs.branch }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Upload wheel
uses: actions/upload-artifact@v7
with:
name: wheel
path: ./dist/
build_deb:
name: Build .deb
needs: build_wheel
runs-on: ubuntu-24.04-arm
env:
PKGNAME: spyglass
strategy:
fail-fast: false
matrix:
arch: [arm64]
distro: [bookworm, trixie]
include:
- arch: arm64
platform: linux/arm64
steps:
- name: Check out
uses: actions/checkout@v6
with:
ref: ${{ inputs.branch }}
- name: Download wheel
uses: actions/download-artifact@v8
with:
name: wheel
path: .
- name: Build inside Debian container (use repo's build_deb.sh)
id: build_in_container
run: |
WORKDIR="$(pwd)"
DISTRO="${{ matrix.distro }}"
PLATFORM="${{ matrix.platform }}"
ARCH="${{ matrix.arch }}"
echo "Packaging ${PKGNAME} arch=${ARCH} distro=${DISTRO} platform=${PLATFORM}"
# Ensure build script is executable in repo
chmod +x ./scripts/build_deb.sh
# Run Debian container (emulated if needed) and call the repository script.
# Pass EXTERNAL_REPO as environment variable so the script can install it into the venv.
docker run --rm --platform="${PLATFORM}" -v "${WORKDIR}:/work" -w /work \
"debian:${DISTRO}-slim" \
bash -eux -o pipefail -c "
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
git \
python3 \
python3-venv \
python3-pip \
python3-av \
binutils \
ruby-full \
curl \
wget
# Install fpm (for Debian packaging)
gem install --no-document fpm
# Run the repository's build script, give it the version argument and EXTERNAL_REPO via env.
# The script in the repo has been adapted to look for EXTERNAL_REPO env var and install it into the venv.
./scripts/build_deb.sh '${DISTRO}'
"
- name: Upload deb
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.distro }}.${{ matrix.arch }}
path: ./*.deb