forked from senthurayyappan/neurobionicspi
-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (145 loc) · 5.99 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
name: Build now!
on:
workflow_dispatch:
inputs:
device:
description: "Device"
required: true
default: Raspberry-Pi-5
type: choice
options:
- Raspberry-Pi-5
- Raspberry-Pi-4
architecture:
description: "Architecture"
required: true
default: 32-bit
type: choice
options:
- 64-bit
- 32-bit
- ubuntu
host_name:
description: "Hostname"
default: neurobionicspi
required: true
user:
description: "Username"
required: true
default: pi
password:
description: "Password"
required: true
default: neurobionics
wifi_cc:
description: "WiFi Country Code"
required: true
default: "US"
type: choice
options:
- US
- GB
- DE
- FR
- IT
- ES
- CA
- AU
- JP
- CN
- KR
- TW
- SG
- IN
- BR
- RU
- ZA
- SA
- AE
- EG
- IL
- TR
- ID
- TH
- VN
- PH
- MY
- MX
- AR
- CL
- CO
- PE
- UY
- EC
- BO
- PY
- CR
- PA
- GT
- HN
- SV
- NI
- DO
- JM
- HT
- CU
- VE
wifi_ssid:
description: "Additional Network SSID"
required: false
wifi_password:
description: "Additional Network Password"
required: false
wpa_ssid:
description: "Access Point SSID"
required: true
default: NeurobionicsRPi
wpa_password:
description: "Access Point Password"
required: true
default: neurobionics
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check secrets
run: |
if [[ -z "${{ secrets.EMAIL_ADDRESS }}" ]]; then
echo "EMAIL_ADDRESS secret is not set, please refer to the README.md for more information. Exiting."
exit 1
fi
if [[ (-z "${{ github.event.inputs.wifi_ssid }}" || -z "${{ github.event.inputs.wifi_password }}") && ( -z "${{ secrets.ENTNETWORK_SSID }}" || -z "${{ secrets.ENTNETWORK_IDENTITY }}" || -z "${{ secrets.ENTNETWORK_PASSWORD }}" ) ]]; then
echo "Please ensure that all required secrets (ENTNETWORK_SSID, ENTNETWORK_IDENTITY, and ENTNETWORK_PASSWORD) are set for the enterprise network. If you do not want to connect to an enterprise network, please provide information for the home network. Exiting."
exit 1
fi
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Write env variables
run: |
echo ARCHITECTURE="${{ github.event.inputs.architecture }}" > $(dirname Raspberry-Pi-5.Pifile)/.env
echo HOSTNAME="${{ github.event.inputs.host_name }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo USER="${{ github.event.inputs.user }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo USERPASSWORD="${{ github.event.inputs.password }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo ENTNETWORK_SSID="${{ secrets.ENTNETWORK_SSID }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo ENTNETWORK_PRIORITY="${{ secrets.ENTNETWORK_PRIORITY }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo ENTNETWORK_IDENTITY="${{ secrets.ENTNETWORK_IDENTITY }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo ENTNETWORK_PASSWORD="${{ secrets.ENTNETWORK_PASSWORD }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo WIFI_CC="${{ github.event.inputs.wifi_cc }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo HOMENETWORK_SSID="${{ github.event.inputs.wifi_ssid }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo HOMENETWORK_PASSWORD="${{ github.event.inputs.wifi_password }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo AP_SSID="${{ github.event.inputs.wpa_ssid }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo AP_PASSWORD="${{ github.event.inputs.wpa_password }}" >> $(dirname Raspberry-Pi-5.Pifile)/.env
echo EMAIL=\"${{ secrets.EMAIL_ADDRESS }}\" >> $(dirname Raspberry-Pi-5.Pifile)/.env
- name: Build image
uses: Nature40/pimod@master
with:
pifile: ${{ github.event.inputs.device }}.Pifile
- name: Make tarball
run: |
tar -czvf ${{ github.event.inputs.device }}.tar.gz ${{ github.event.inputs.device }}.img
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.workflow }}-${{ github.sha }}.zip
path: ${{ github.event.inputs.device }}.img