-
Notifications
You must be signed in to change notification settings - Fork 102
164 lines (145 loc) · 7.57 KB
/
release.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
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
env:
BIND_VERSION: ${{ github.event.inputs.bind }}
IPFS_VERSION: ${{ github.event.inputs.ipfs }}
DAPPMANAGER_VERSION: ${{ github.event.inputs.dappmanager }}
WIFI_VERSION: ${{ github.event.inputs.wifi }}
WIREGUARD_VERSION: ${{ github.event.inputs.wireguard }}
HTTPS_VERSION: ${{ github.event.inputs.https }}
VPN_VERSION: ${{ github.event.inputs.vpn }}
CORE_VERSION: ${{ github.event.inputs.core }}
jobs:
pre-release:
name: create pre release
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
# Regex for versions introduced
- name: Check versions regex
run: |
[[ $BIND_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ $IPFS_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ $DAPPMANAGER_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && \
[[ $WIFI_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ $WIREGUARD_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ $HTTPS_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && \
[[ $VPN_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ $CORE_VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "versions introduced in wrong format"; exit 1; }
- name: Checkout
uses: actions/checkout@v4
# Edit the profile with the new versions introduced
- name: Set new versions
run: |
sed -i -e "/BIND_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${BIND_VERSION}"/" .dappnode_profile
sed -i -e "/IPFS_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${IPFS_VERSION}"/" .dappnode_profile
sed -i -e "/VPN_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${VPN_VERSION}"/" .dappnode_profile
sed -i -e "/DAPPMANAGER_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${DAPPMANAGER_VERSION}"/" .dappnode_profile
sed -i -e "/WIFI_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${WIFI_VERSION}"/" .dappnode_profile
sed -i -e "/WIREGUARD_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${WIREGUARD_VERSION}"/" .dappnode_profile
sed -i -e "/HTTPS_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${HTTPS_VERSION}"/" .dappnode_profile
cat .dappnode_profile
# ISO ATTENDED
- name: Build attended
run: |
sed -i -e "/UNATTENDED/s/true/false/" docker-compose.yml
docker-compose build
docker-compose up
# Verify ISO attended created
- name: Check iso attended
run: |
ls -lrt images/DAppNode-debian-bookworm-amd64.iso
# Set new name for the release asset
- name: Set DAppNode attended ISO name
run: |
cp ./images/DAppNode-debian-bookworm-amd64.iso DAppNode-${CORE_VERSION}-debian-bookworm-amd64.iso
# ISO UNATTENDED
- name: Build unattended
run: |
sed -i -e "/UNATTENDED/s/false/true/" docker-compose.yml
docker-compose build
docker-compose up
# Verify ISO unattended was created
- name: Check iso unattended
run: |
ls -lrt images/DAppNode-debian-bookworm-amd64.iso
# Set new name for the release asset
- name: Set DAppNode unttended ISO name
run: |
cp ./images/DAppNode-debian-bookworm-amd64.iso DAppNode-${CORE_VERSION}-debian-bookworm-amd64-unattended.iso
# Create profile.sh script (not able to set dot (.) before the name in the gh release asset)
- name: Create dappnode_profile.sh
run: |
cp .dappnode_profile dappnode_profile.sh
# SHASUMs
- name: Get SHA-256 attended
id: shasum-attended
run: |
SHASUM_ATTENDED=$(shasum -a 256 DAppNode-${CORE_VERSION}-debian-bookworm-amd64.iso)
echo "::set-output name=SHASUM_ATTENDED::$SHASUM_ATTENDED"
- name: Get SHA-256 unattended
id: shasum-unattended
run: |
SHASUM_UNATTENDED=$(shasum -a 256 DAppNode-${CORE_VERSION}-debian-bookworm-amd64-unattended.iso)
echo "::set-output name=SHASUM_UNATTENDED::$SHASUM_UNATTENDED"
# Release body
- name: Write release content
run: |
echo -en "# Versions\n| Package | Version |\n|---|---|\nbind.dnp.dappnode.eth|${BIND_VERSION}|\n|ipfs.dnp.dappnode.eth|${IPFS_VERSION}|\n|vpn.dnp.dappnode.eth |${VPN_VERSION}|\n|dappmanager.dnp.dappnode.eth|${DAPPMANAGER_VERSION}|\n|wifi.dnp.dappnode.eth|${WIFI_VERSION}|\n|https.dnp.dappnode.eth|${HTTPS_VERSION}|\n|wireguard.dnp.dappnode.eth|${WIREGUARD_VERSION}|\n# Changes\nChanges implemented in release ${CORE_VERSION}\n# Attended version\nInstall and customize DAppNode using the attended ISO: **DAppNode-${CORE_VERSION}-debian-bookworm-amd64.iso**\n\n## ISO SHA-256 Checksum\n\`\`\`\nshasum -a 256 DAppNode-${CORE_VERSION}-debian-bookworm-amd64.iso\n${SHASUM_ATTENDED}\n\`\`\`\n# Unattended version\nInstall DAppNode easily using the unattended ISO: **DAppNode-${CORE_VERSION}-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\ndefault login data:\n - **__user__**: dappnode\n - **__password__**: dappnode.s0\n## ISO SHA-256 Checksum\n\`\`\`\nshasum -a 256 DAppNode-${CORE_VERSION}-debian-bookworm-amd64-unattended.iso\n${SHASUM_UNATTENDED}\n\`\`\`\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
env:
SHASUM_ATTENDED: ${{ steps.shasum-attended.outputs.SHASUM_ATTENDED }}
SHASUM_UNATTENDED: ${{ steps.shasum-unattended.outputs.SHASUM_UNATTENDED }}
# PRE-RELEASE ASSETS
- name: Pre release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.core }}
prerelease: true
files: |
./DAppNode-*-amd64.iso
./DAppNode-*-amd64-unattended.iso
./scripts/dappnode_install.sh
./scripts/dappnode_install_pre.sh
./scripts/dappnode_uninstall.sh
./scripts/dappnode_access_credentials.sh
dappnode_profile.sh
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check git diff
id: git_diff
run: |
git diff --no-index --word-diff-regex=[^[:space:]] --no-patch .dappnode_profile && echo '::set-output name=HAS_CHANGED::true' || echo '::set-output name=HAS_CHANGED::false'
- name: Create Pull Request
if: steps.git_diff.outputs.HAS_CHANGED == 'true'
uses: peter-evans/create-pull-request@v5
with:
add-paths: ".dappnode_profile"
commit-message: "update core packages versions"
branch: "update-profile"
title: "update core packages versions"
delete-branch: true