-
Notifications
You must be signed in to change notification settings - Fork 5
124 lines (112 loc) · 3.47 KB
/
build.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
name: Build
on:
push:
workflow_dispatch:
jobs:
Build-PC:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2022, ubuntu-22.04, ubuntu-20.04, macos-12]
steps:
- name: Obtain latest version of the repository
uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install requirements with PIP
run: pip install --break-system-packages -r requirements.txt
- name: Install pyinstaller
run: pip install --break-system-packages pyinstaller
- name: Build RiiTag RPC
run: pyinstaller riitag-rpc.spec
- name: Mark as executable
if: ${{ matrix.os != 'windows-2022' }}
run: chmod -R +x dist/
- name: Publish Build Artifacts
uses: actions/upload-artifact@master
with:
name: ${{ matrix.os }}-x64
path: dist
Build-RPI:
runs-on: ubuntu-22.04
strategy:
matrix:
target: [rpi_4b_aarch64]
include:
- target: rpi_4b_aarch64
cpu: cortex-a53
cpu_info: cpuinfo/raspberrypi_4b
base_image: raspios_lite_arm64:latest
steps:
- uses: actions/checkout@v3
- name: Build Raspberry pi release
uses: pguyot/arm-runner-action@v2
with:
base_image: ${{ matrix.base_image }}
cpu: ${{ matrix.cpu }}
cpu_info: ${{ matrix.cpu_info }}
bind_mount_repository: true
commands: |
sudo apt-get update
sudo apt-get install -y python3-pip
pip3 install --break-system-packages -r requirements.txt
pip3 install --break-system-packages pyinstaller
pyinstaller riitag-rpc.spec
chmod +x -R dist/
- name: Publish Build Artifacts
uses: actions/upload-artifact@master
with:
name: rpi-4b-aarch64
path: dist
Collect-Artifacts:
runs-on: ubuntu-22.04
needs: [Build-PC, Build-RPI]
steps:
- name: Download ubuntu-22.04-x64
uses: actions/download-artifact@v3
with:
name: ubuntu-22.04-x64
path: ubuntu22
- name: Download ubuntu-20.04-x64
uses: actions/download-artifact@v3
with:
name: ubuntu-20.04-x64
path: ubuntu20
- name: Download macos-12-x64
uses: actions/download-artifact@v3
with:
name: macos-12-x64
path: macos
- name: Download windows-2022-x64
uses: actions/download-artifact@v3
with:
name: windows-2022-x64
path: windows
- name: Download rpi-4b-aarch64
uses: actions/download-artifact@v3
with:
name: rpi-4b-aarch64
path: rpi4b
- name: Collect artifacts
run: |
mkdir -p releases
mv ubuntu22/riitag-rpc releases/RiiTag-RPC_Ubuntu22
mv ubuntu20/riitag-rpc releases/RiiTag-RPC_Ubuntu20
mv macos/riitag-rpc releases/RiiTag-RPC_MacOS
mv windows/riitag-rpc releases/RiiTag-RPC_Windows
mv rpi4b/riitag-rpc releases/RiiTag-RPC_Rpi4B
tar -cvf all-artifacts.tar.bz2 releases/
- name: Upload collected artifacts
uses: actions/upload-artifact@v3
with:
name: all-artifacts
path: all-artifacts.tar.bz2
- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: releases/*