-
-
Notifications
You must be signed in to change notification settings - Fork 33
169 lines (140 loc) · 4.94 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
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
name: build
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- created
workflow_dispatch:
jobs:
build-firmware:
runs-on: ubuntu-latest
steps:
- name: Download SummerCart64 repository
uses: actions/checkout@v4
- name: Set package version
uses: frabert/replace-string-action@v2
id: version
with:
pattern: '\/'
string: '${{ github.ref_name }}'
replace-with: '-'
- name: Build firmware
run: ./docker_build.sh release --force-clean
env:
SC64_VERSION: ${{ steps.version.outputs.replaced }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sc64-pkg-${{ steps.version.outputs.replaced }}
path: |
sc64-extra-${{ steps.version.outputs.replaced }}.zip
sc64-firmware-${{ steps.version.outputs.replaced }}.bin
- name: Upload release assets
if: github.event_name == 'release' && github.event.action == 'created'
uses: softprops/[email protected]
with:
files: |
sc64-extra-${{ steps.version.outputs.replaced }}.zip
sc64-firmware-${{ steps.version.outputs.replaced }}.bin
build-deployer:
strategy:
matrix:
# version: [windows, windows-32bit, linux, macos]
version: [linux, macos]
include:
# - version: windows
# os: windows-latest
# executable: target/release/sc64deployer.exe
# package-name: sc64-deployer-windows
# package-params: -c -a -f
# package-extension: zip
# - version: windows-32bit
# os: windows-latest
# build-params: --target=i686-pc-windows-msvc
# executable: target/i686-pc-windows-msvc/release/sc64deployer.exe
# package-name: sc64-deployer-windows-32bit
# package-params: -c -a -f
# package-extension: zip
- version: linux
os: ubuntu-latest
apt-packages: libftdi-dev libudev-dev
executable: target/release/sc64deployer
package-name: sc64-deployer-linux
package-params: -czf
package-extension: tar.gz
- version: macos
os: macos-latest
brew-packages: libftdi
executable: target/release/sc64deployer
package-name: sc64-deployer-macos
package-params: -czf
package-extension: tgz
runs-on: ${{ matrix.os }}
steps:
- name: Download SummerCart64 repository
uses: actions/checkout@v4
- name: Set package version
uses: frabert/replace-string-action@v2
id: version
with:
pattern: '\/'
string: '${{ github.ref_name }}'
replace-with: '-'
- name: Install apt packages
if: matrix.apt-packages
run: |
sudo apt-get update
sudo apt-get -y install ${{ matrix.apt-packages }}
- name: Install brew packages
if: matrix.brew-packages
run: yes | brew install ${{ matrix.brew-packages }}
- name: Build deployer
run: cargo b -r ${{ matrix.build-params }}
working-directory: sw/deployer
- name: Package executable
run: |
mkdir -p ./package
cp ${{ matrix.executable }} ./package/
cd ./package
tar ${{ matrix.package-params }} ./${{ matrix.package-name }}-${{ steps.version.outputs.replaced }}.${{ matrix.package-extension }} *
working-directory: sw/deployer
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package-name }}-${{ steps.version.outputs.replaced }}
path: sw/deployer/package/${{ matrix.package-name }}-${{ steps.version.outputs.replaced }}.${{ matrix.package-extension }}
- name: Upload release assets
if: github.event_name == 'release' && github.event.action == 'created'
uses: softprops/[email protected]
with:
files: |
sw/deployer/package/${{ matrix.package-name }}-${{ steps.version.outputs.replaced }}.${{ matrix.package-extension }}
publish-website:
if: github.ref == 'refs/heads/main'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Download SummerCart64 repository
uses: actions/checkout@v4
- name: Copy BOM file to the website folder
run: cp ./hw/pcb/sc64v2_bom.html ./web
- name: Setup GitHub pages
uses: actions/configure-pages@v4
- name: Upload website artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./web
- name: Publish website from uploaded artifact
id: deployment
uses: actions/deploy-pages@v4