-
-
Notifications
You must be signed in to change notification settings - Fork 13
95 lines (80 loc) · 2.42 KB
/
Copy pathbuild-speculos.yml
File metadata and controls
95 lines (80 loc) · 2.42 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
name: Build Speculos Binary
on:
workflow_dispatch:
inputs:
version:
description: 'Speculos version to build'
required: true
default: '0.25.13'
push:
tags:
- 'speculos-v*'
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runner: ubuntu-latest
file_arch: x86-64
- arch: arm64
# PyInstaller bundles the host arch; arm64 must build on arm64.
runner: macos-12.0
file_arch: 'ARM aarch64'
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Install speculos
run: pip install speculos==${{ github.event.inputs.version || '0.25.13' }}
- name: Build standalone binary
run: |
mkdir -p dist
pyinstaller \
--onefile \
--name speculos \
--distpath dist \
--workpath build \
--noupx \
--collect-all speculos \
"$(python -c 'import speculos; print(speculos.__file__)')"
- name: Verify binary architecture
run: |
file dist/speculos | tee /tmp/speculos-file.txt
grep -Fq '${{ matrix.file_arch }}' /tmp/speculos-file.txt
- name: Package archive
run: |
VERSION="${{ github.event.inputs.version || '0.25.13' }}"
cd dist
tar -czf speculos-v${VERSION}-linux-${{ matrix.arch }}.tar.gz speculos
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: speculos-linux-${{ matrix.arch }}
path: dist/speculos-v*-linux-${{ matrix.arch }}.tar.gz
if-no-files-found: error
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
pattern: speculos-linux-*
path: dist
merge-multiple: true
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
tag_name: speculos-v${{ github.event.inputs.version || '0.25.13' }}
files: dist/*.tar.gz