Skip to content

Pre-release

Pre-release #181

Workflow file for this run

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 artifacts
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- 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
- 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
- name: Build Debian attended
run: |
export BASE_OS=debian
export UNATTENDED=false
docker compose up --build
- name: Check Debian ISO attended
run: |
ls -lrt images/Dappnode-debian-*.iso
- name: Set Debian Dappnode attended ISO name
run: |
file=$(ls images/Dappnode-debian-*.iso)
filename=$(basename "$file") # Extract only the file name (without path)
core_filename="Dappnode-${CORE_VERSION}-debian-${filename#Dappnode-debian-}" # Modify the filename using CORE_VERSION
attended_filename="${core_filename/%.iso/-attended.iso}" # Replace .iso with -attended.iso
sudo cp "$file" "images/$attended_filename"
- name: Build Debian unattended
run: |
export BASE_OS=debian
export UNATTENDED=true
docker compose build
docker compose up
- name: Check Debian ISO unattended
run: |
ls -lrt images/Dappnode-debian-*.iso
- name: Set Debian Dappnode unattended ISO name
run: |
file=$(ls images/Dappnode-debian-*.iso)
filename=$(basename "$file") # Extract only the file name (without path)
core_filename="Dappnode-${CORE_VERSION}-debian-${filename#Dappnode-debian-}" # Modify the filename using CORE_VERSION
unattended_filename="${core_filename/%.iso/-unattended.iso}" # Replace .iso with -unattended.iso
sudo cp "$file" "images/$unattended_filename"
- name: Build Ubuntu unattended
run: |
export BASE_OS=ubuntu
export UNATTENDED=true
docker compose up --build
- name: Check Ubuntu ISO unattended
run: |
ls -lrt images/Dappnode-ubuntu-*.iso
- name: Set Ubuntu Dappnode unattended ISO name
run: |
file=$(ls images/Dappnode-ubuntu-*.iso)
filename=$(basename "$file") # Extract only the file name (without path)
core_filename="Dappnode-${CORE_VERSION}-ubuntu-${filename#Dappnode-ubuntu-}" # Modify the filename using CORE_VERSION
unattended_filename="${core_filename/%.iso/-unattended.iso}" # Replace .iso with -unattended.iso
sudo cp "$file" "images/$unattended_filename"
- name: Create dappnode_profile.sh
run: |
cp .dappnode_profile dappnode_profile.sh
# SHASUMs
- name: Get SHA-256 Debian attended
id: shasum-debian-attended
run: |
file=$(find . -type f -name 'Dappnode-debian-*.iso' ! -name '*unattended*')
SHASUM_DEBIAN_ATTENDED=$(shasum -a 256 $file)
echo "::set-output name=SHASUM_DEBIAN_ATTENDED::$SHASUM_DEBIAN_ATTENDED"
- name: Get SHA-256 Debian unattended
id: shasum-debian-unattended
run: |
file=$(find . -type f -name 'Dappnode-debian-*unattended.iso')
SHASUM_DEBIAN_UNATTENDED=$(shasum -a 256 $file)
echo "::set-output name=SHASUM_DEBIAN_UNATTENDED::$SHASUM_DEBIAN_UNATTENDED"
- name: Get SHA-256 Ubuntu unattended
id: shasum-ubuntu-unattended
run: |
file=$(find . -type f -name 'Dappnode-ubuntu-*unattended.iso')
SHASUM_UBUNTU_UNATTENDED=$(shasum -a 256 $file)
echo "$SHASUM_UBUNTU_UNATTENDED" > SHASUM_UBUNTU_UNATTENDED.txt
echo "::set-output name=SHASUM_UBUNTU_UNATTENDED::$SHASUM_UBUNTU_UNATTENDED"
- 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# Debian 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_DEBIAN_ATTENDED}\n\`\`\`\n# Debian 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\n## ISO SHA-256 Checksum\n\`\`\`\nshasum -a 256 DAppNode-${CORE_VERSION}-debian-bookworm-amd64-unattended.iso\n${SHASUM_DEBIAN_UNATTENDED}\n\`\`\`\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\`\`\`\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_DEBIAN_ATTENDED: ${{ steps.shasum-debian-attended.outputs.SHASUM_DEBIAN_ATTENDED }}
SHASUM_DEBIAN_UNATTENDED: ${{ steps.shasum-debian-unattended.outputs.SHASUM_DEBIAN_UNATTENDED }}
# print images directory
- 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: ${{ github.event.inputs.core }}
prerelease: true
files: |
./images/Dappnode-*-debian-*-attended.iso
./images/Dappnode-*-debian-*-unattended.iso
./scripts/dappnode_install*.sh
./scripts/dappnode_uninstall*.sh
dappnode_profile.sh
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Ubuntu unattended to SSH server (and shasum)
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/Dappnode-*-ubuntu-*-unattended.iso
target: ${{ secrets.ISO_SSH_PATH }}
overwrite: true