-
Notifications
You must be signed in to change notification settings - Fork 116
264 lines (259 loc) · 13.4 KB
/
release.yml
File metadata and controls
264 lines (259 loc) · 13.4 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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
name: Pre-release
on:
workflow_dispatch:
inputs:
core:
description: "Version of the Core. Must be prefixed with v (e.g v0.2.47)"
required: true
dappmanager:
description: "Version of the Dappmanager. Only numbers"
required: true
wifi:
description: "Version of the WiFi Package. Only numbers"
required: true
bind:
description: "Version of the Bind Package. Only numbers"
required: true
ipfs:
description: "Version of the IPFS Package. Only numbers"
required: true
https:
description: "Version of the HTTPS Package. Only numbers"
required: true
wireguard:
description: "Version of the Wireguard Package. Only numbers"
required: true
vpn:
description: "Version of the OpenVPN Package. Only numbers"
required: true
notifications:
description: "IPFS hash of the Notifications Package. Must start with /ipfs/"
required: true
premium:
description: "IPFS hash of the Premium Package. Must start with /ipfs/"
required: true
jobs:
set-versions:
name: Set versions and check regex
runs-on: ubuntu-latest
outputs:
bind: ${{ steps.set_outputs.outputs.bind }}
ipfs: ${{ steps.set_outputs.outputs.ipfs }}
dappmanager: ${{ steps.set_outputs.outputs.dappmanager }}
wifi: ${{ steps.set_outputs.outputs.wifi }}
wireguard: ${{ steps.set_outputs.outputs.wireguard }}
https: ${{ steps.set_outputs.outputs.https }}
vpn: ${{ steps.set_outputs.outputs.vpn }}
notifications: ${{ steps.set_outputs.outputs.notifications }}
premium: ${{ steps.set_outputs.outputs.premium }}
core: ${{ steps.set_outputs.outputs.core }}
steps:
- name: Check versions regex
run: |
[[ "${{ github.event.inputs.bind }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.event.inputs.ipfs }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.event.inputs.dappmanager }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && \
[[ "${{ github.event.inputs.wifi }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.event.inputs.wireguard }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.event.inputs.https }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && \
[[ "${{ github.event.inputs.vpn }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.event.inputs.core }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && \
[[ "${{ github.event.inputs.notifications }}" =~ ^/ipfs/.+$ ]] && [[ "${{ github.event.inputs.premium }}" =~ ^/ipfs/.+$ ]] || { echo "versions introduced in wrong format"; exit 1; }
- name: Checkout
uses: actions/checkout@v4
- name: Set new versions
run: |
sed -i -e "/BIND_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${{ github.event.inputs.bind }}"/" .dappnode_profile
sed -i -e "/IPFS_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${{ github.event.inputs.ipfs }}"/" .dappnode_profile
sed -i -e "/VPN_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${{ github.event.inputs.vpn }}"/" .dappnode_profile
sed -i -e "/DAPPMANAGER_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${{ github.event.inputs.dappmanager }}"/" .dappnode_profile
sed -i -e "/WIFI_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${{ github.event.inputs.wifi }}"/" .dappnode_profile
sed -i -e "/WIREGUARD_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${{ github.event.inputs.wireguard }}"/" .dappnode_profile
sed -i -e "/HTTPS_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/${{ github.event.inputs.https }}/" .dappnode_profile
sed -i -e "s|^export NOTIFICATIONS_VERSION=.*|export NOTIFICATIONS_VERSION=\"${{ github.event.inputs.notifications }}\"|" .dappnode_profile
sed -i -e "s|^export PREMIUM_VERSION=.*|export PREMIUM_VERSION=\"${{ github.event.inputs.premium }}\"|" .dappnode_profile
cat .dappnode_profile
- name: Create dappnode_profile.sh
run: cp .dappnode_profile dappnode_profile.sh
- name: Upload dappnode_profile.sh
uses: actions/upload-artifact@v4
with:
name: dappnode_profile
path: dappnode_profile.sh
- name: Set outputs
id: set_outputs
run: |
echo "core=${{ github.event.inputs.core }}" >> $GITHUB_OUTPUT
echo "bind=${{ github.event.inputs.bind }}" >> $GITHUB_OUTPUT
echo "ipfs=${{ github.event.inputs.ipfs }}" >> $GITHUB_OUTPUT
echo "dappmanager=${{ github.event.inputs.dappmanager }}" >> $GITHUB_OUTPUT
echo "wifi=${{ github.event.inputs.wifi }}" >> $GITHUB_OUTPUT
echo "wireguard=${{ github.event.inputs.wireguard }}" >> $GITHUB_OUTPUT
echo "https=${{ github.event.inputs.https }}" >> $GITHUB_OUTPUT
echo "vpn=${{ github.event.inputs.vpn }}" >> $GITHUB_OUTPUT
echo "notifications=${{ github.event.inputs.notifications }}" >> $GITHUB_OUTPUT
echo "premium=${{ github.event.inputs.premium }}" >> $GITHUB_OUTPUT
build-debian-attended:
name: Build Debian attended ISO
runs-on: ubuntu-latest
needs: set-versions
steps:
- uses: actions/checkout@v4
- name: Download dappnode_profile
uses: actions/download-artifact@v4
with:
name: dappnode_profile
- name: Rename dappnode_profile.sh to .dappnode_profile
run: mv dappnode_profile.sh .dappnode_profile
- name: Build Debian attended
run: |
export BASE_OS=debian
export UNATTENDED=false
docker compose up --build
- name: Set Debian Dappnode attended ISO name
run: |
file=$(ls images/Dappnode-debian-*.iso)
filename=$(basename "$file")
core_filename="Dappnode-${{ needs.set-versions.outputs.core }}-debian-${filename#Dappnode-debian-}"
attended_filename="${core_filename/%.iso/-attended.iso}"
sudo cp "$file" "images/$attended_filename"
- name: Upload Debian attended ISO
uses: actions/upload-artifact@v4
with:
name: debian-attended-iso
path: images/*-attended.iso
- name: Get SHA-256 Debian attended
run: |
file=$(find images/ -type f -name '*-attended.iso')
shasum -a 256 $file > SHASUM_DEBIAN_ATTENDED.txt
- name: Upload Debian attended SHA256
uses: actions/upload-artifact@v4
with:
name: debian-attended-sha
path: SHASUM_DEBIAN_ATTENDED.txt
build-debian-unattended:
name: Build Debian unattended ISO
runs-on: ubuntu-latest
needs: set-versions
steps:
- uses: actions/checkout@v4
- name: Download dappnode_profile
uses: actions/download-artifact@v4
with:
name: dappnode_profile
- name: Rename dappnode_profile.sh to .dappnode_profile
run: mv dappnode_profile.sh .dappnode_profile
- name: Build Debian unattended
run: |
export BASE_OS=debian
export UNATTENDED=true
docker compose build
docker compose up
- name: Set Debian Dappnode unattended ISO name
run: |
file=$(ls images/Dappnode-debian-*.iso)
filename=$(basename "$file")
core_filename="Dappnode-${{ needs.set-versions.outputs.core }}-debian-${filename#Dappnode-debian-}"
unattended_filename="${core_filename/%.iso/-unattended.iso}"
sudo cp "$file" "images/$unattended_filename"
- name: Upload Debian unattended ISO
uses: actions/upload-artifact@v4
with:
name: debian-unattended-iso
path: images/*-unattended.iso
- name: Get SHA-256 Debian unattended
run: |
file=$(find images/ -type f -name '*-unattended.iso')
shasum -a 256 $file > SHASUM_DEBIAN_UNATTENDED.txt
- name: Upload Debian unattended SHA256
uses: actions/upload-artifact@v4
with:
name: debian-unattended-sha
path: SHASUM_DEBIAN_UNATTENDED.txt
build-ubuntu-unattended:
name: Build Ubuntu unattended ISO
runs-on: ubuntu-latest
needs: set-versions
steps:
- uses: actions/checkout@v4
- name: Download dappnode_profile
uses: actions/download-artifact@v4
with:
name: dappnode_profile
- name: Rename dappnode_profile.sh to .dappnode_profile
run: mv dappnode_profile.sh .dappnode_profile
- name: Build Ubuntu unattended
run: |
export BASE_OS=ubuntu
export UNATTENDED=true
docker compose up --build
- name: Set Ubuntu Dappnode unattended ISO name
run: |
file=$(ls images/Dappnode-ubuntu-*.iso)
filename=$(basename "$file")
core_filename="Dappnode-${{ needs.set-versions.outputs.core }}-ubuntu-${filename#Dappnode-ubuntu-}"
unattended_filename="${core_filename/%.iso/-unattended.iso}"
sudo cp "$file" "images/$unattended_filename"
- name: Get SHA-256 Ubuntu unattended
run: |
file=$(find images/ -type f -name '*-ubuntu-*-unattended.iso')
shasum -a 256 $file > SHASUM_UBUNTU_UNATTENDED.txt
- name: Upload Ubuntu unattended ISO and SHA256 to SSH
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.ISO_SSH_HOST }}
username: ${{ secrets.ISO_SSH_USER }}
key: ${{ secrets.ISO_SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
source: SHASUM_UBUNTU_UNATTENDED.txt,images/*-ubuntu-*-unattended.iso
target: ${{ secrets.ISO_SSH_PATH }}
overwrite: true
- name: Upload Ubuntu unattended SHA256 as artifact
uses: actions/upload-artifact@v4
with:
name: ubuntu-unattended-sha
path: SHASUM_UBUNTU_UNATTENDED.txt
release:
name: Combine, release, and upload
runs-on: ubuntu-latest
needs:
- set-versions
- build-debian-attended
- build-debian-unattended
- build-ubuntu-unattended
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Move ISOs and SHAs
run: |
mkdir -p images
mv artifacts/debian-attended-iso/* images/
mv artifacts/debian-unattended-iso/* images/
mv artifacts/debian-attended-sha/* .
mv artifacts/debian-unattended-sha/* .
mv artifacts/ubuntu-unattended-sha/* .
mv artifacts/dappnode_profile/* .
- name: Write release content
run: |
SHASUM_DEBIAN_ATTENDED=$(cat SHASUM_DEBIAN_ATTENDED.txt)
SHASUM_DEBIAN_UNATTENDED=$(cat SHASUM_DEBIAN_UNATTENDED.txt)
SHASUM_UBUNTU_UNATTENDED=$(cat SHASUM_UBUNTU_UNATTENDED.txt)
echo -en "# Versions\n| Package | Version |\n|---|---|\nbind.dnp.dappnode.eth|${{ needs.set-versions.outputs.bind }}|\n|ipfs.dnp.dappnode.eth|${{ needs.set-versions.outputs.ipfs }}|\n|vpn.dnp.dappnode.eth |${{ needs.set-versions.outputs.vpn }}|\n|dappmanager.dnp.dappnode.eth|${{ needs.set-versions.outputs.dappmanager }}|\n|wifi.dnp.dappnode.eth|${{ needs.set-versions.outputs.wifi }}|\n|https.dnp.dappnode.eth|${{ needs.set-versions.outputs.https }}|\n|wireguard.dnp.dappnode.eth|${{ needs.set-versions.outputs.wireguard }}|\n|notifications.dnp.dappnode.eth|${{ needs.set-versions.outputs.notifications }}|\n|premium.dnp.dappnode.eth|${{ needs.set-versions.outputs.premium }}|\n# Changes\nChanges implemented in release ${{ needs.set-versions.outputs.core }}\n# Debian Attended version\nInstall and customize DAppNode using the attended ISO: **DAppNode-${{ needs.set-versions.outputs.core }}-debian-bookworm-amd64.iso**\n\n## ISO SHA-256 Checksum\n```\nshasum -a 256 DAppNode-${{ needs.set-versions.outputs.core }}-debian-bookworm-amd64.iso\n$SHASUM_DEBIAN_ATTENDED\n```\n# Debian Unattended version\nInstall DAppNode easily using the unattended ISO: **DAppNode-${{ needs.set-versions.outputs.core }}-debian-bookworm-amd64-unattended.iso**\nDo a reboot right after the installation\n:warning: **Warning**: This ISO will install Dappnode automatically, deleting all existing partitions on the disk\n\n## ISO SHA-256 Checksum\n```\nshasum -a 256 DAppNode-${{ needs.set-versions.outputs.core }}-debian-bookworm-amd64-unattended.iso\n$SHASUM_DEBIAN_UNATTENDED\n```\n# Ubuntu Unattended version\nInstall DAppNode easily using the unattended ISO: **DAppNode-${{ needs.set-versions.outputs.core }}-ubuntu-bookworm-amd64-unattended.iso**\n\n## ISO SHA-256 Checksum\n```\nshasum -a 256 DAppNode-${{ needs.set-versions.outputs.core }}-ubuntu-bookworm-amd64-unattended.iso\n$SHASUM_UBUNTU_UNATTENDED\n```\nUploaded at https://ubuntu.iso.dappnode.io\n# DAppNode for Raspberry Pi 4 64bit\n[Instructions](https://github.com/dappnode/DAppNode/wiki/DAppNodeARM-Installation-Guide)\n\ndefault login data:\n - **__user__**: dappnode\n - **__password__**: dappnodepi" > CHANGELOG.md
cat CHANGELOG.md
- name: Print images directory
run: |
echo "Images directory content:"
ls -lrt images/
- name: Create pre-release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.set-versions.outputs.core }}
prerelease: true
files: |
./images/Dappnode-*-debian-*-attended.iso
./images/Dappnode-*-debian-*-unattended.iso
./scripts/dappnode_install*.sh
./scripts/dappnode_uninstall*.sh
./scripts/dappnode_access_credentials*.sh
dappnode_profile.sh
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}