V8.03.148.2025.06.02
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -62,12 +62,12 @@ jobs:
|
|||||||
wget \
|
wget \
|
||||||
whois
|
whois
|
||||||
|
|
||||||
- name: Check GnuPG Version.
|
- name: ⚙️ Check GnuPG Version.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
gpg --version
|
gpg --version
|
||||||
|
|
||||||
- name: Preparing SSH Setup, SSH Deploy Key, Known Hosts, .config.
|
- name: ⚙️ Preparing SSH Setup, SSH Deploy Key, Known Hosts, .config.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
|
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
|
||||||
@@ -92,7 +92,7 @@ jobs:
|
|||||||
chmod 600 ~/.ssh/config
|
chmod 600 ~/.ssh/config
|
||||||
|
|
||||||
### https://github.com/actions/checkout/issues/1843
|
### https://github.com/actions/checkout/issues/1843
|
||||||
- name: Using manual clone via SSH to circumvent Gitea SHA-256 object issues.
|
- name: 🛠️ Using manual clone via SSH to circumvent Gitea SHA-256 object issues.
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
### GITHUB_REF_NAME contains the branch name from the push event.
|
### GITHUB_REF_NAME contains the branch name from the push event.
|
||||||
@@ -101,15 +101,16 @@ jobs:
|
|||||||
git clone --branch "${GITHUB_REF_NAME}" ssh://git@git.coresecret.dev:42842/msw/CISS.debian.live.builder.git .
|
git clone --branch "${GITHUB_REF_NAME}" ssh://git@git.coresecret.dev:42842/msw/CISS.debian.live.builder.git .
|
||||||
git fetch --unshallow || echo "Nothing to fetch - already full clone."
|
git fetch --unshallow || echo "Nothing to fetch - already full clone."
|
||||||
|
|
||||||
- name: Cleaning the workspace.
|
- name: 🛠️ Cleaning the workspace.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
git reset --hard
|
git reset --hard
|
||||||
git clean -fd
|
git clean -fd
|
||||||
|
|
||||||
- name: Importing the 'CI PGP DEPLOY ONLY' key.
|
- name: ⚙️ Importing the 'CI PGP DEPLOY ONLY' key.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
### GPG-Home relative to the Runner Workspace to avoid changing global files.
|
### GPG-Home relative to the Runner Workspace to avoid changing global files.
|
||||||
export GNUPGHOME="$(pwd)/.gnupg"
|
export GNUPGHOME="$(pwd)/.gnupg"
|
||||||
mkdir -m 700 "${GNUPGHOME}"
|
mkdir -m 700 "${GNUPGHOME}"
|
||||||
@@ -119,9 +120,10 @@ jobs:
|
|||||||
KEY_ID=$(gpg --list-keys --with-colons | awk -F: '/^pub:/ {print $5}')
|
KEY_ID=$(gpg --list-keys --with-colons | awk -F: '/^pub:/ {print $5}')
|
||||||
echo "trust-model always" >| "${GNUPGHOME}/gpg.conf"
|
echo "trust-model always" >| "${GNUPGHOME}/gpg.conf"
|
||||||
|
|
||||||
- name: Configuring Git for signed CI/DEPLOY commits.
|
- name: ⚙️ Configuring Git for signed CI/DEPLOY commits.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
export GNUPGHOME="$(pwd)/.gnupg"
|
export GNUPGHOME="$(pwd)/.gnupg"
|
||||||
git config user.name "Marc S. Weidner BOT"
|
git config user.name "Marc S. Weidner BOT"
|
||||||
git config user.email "msw+bot@coresecret.dev"
|
git config user.email "msw+bot@coresecret.dev"
|
||||||
@@ -129,9 +131,10 @@ jobs:
|
|||||||
git config gpg.program gpg
|
git config gpg.program gpg
|
||||||
git config gpg.format openpgp
|
git config gpg.format openpgp
|
||||||
|
|
||||||
- name: Preparing the build environment.
|
- name: ⚙️ Preparing the build environment.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
mkdir -p /opt/config
|
mkdir -p /opt/config
|
||||||
mkdir -p /opt/livebuild
|
mkdir -p /opt/livebuild
|
||||||
touch /opt/config/password.txt && chmod 0600 /opt/config/password.txt
|
touch /opt/config/password.txt && chmod 0600 /opt/config/password.txt
|
||||||
@@ -139,9 +142,10 @@ jobs:
|
|||||||
echo "${{ secrets.CISS_DLB_ROOT_PWD }}" >| /opt/config/password.txt
|
echo "${{ secrets.CISS_DLB_ROOT_PWD }}" >| /opt/config/password.txt
|
||||||
echo "${{ secrets.CISS_DLB_ROOT_SSH_PUBKEY }}" >| /opt/config/authorized_keys
|
echo "${{ secrets.CISS_DLB_ROOT_SSH_PUBKEY }}" >| /opt/config/authorized_keys
|
||||||
|
|
||||||
- name: Starting CISS.debian.live.builder. This may take a while ...
|
- name: 🛠️ Starting CISS.debian.live.builder. This may take a while ...
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
chmod 0755 ciss_live_builder.sh
|
chmod 0755 ciss_live_builder.sh
|
||||||
timestamp=$(date -u +"%Y_%m_%dT%H_%M_%SZ")
|
timestamp=$(date -u +"%Y_%m_%dT%H_%M_%SZ")
|
||||||
### Change "--autobuild=" to the specific kernel version you need: 6.12.22+bpo-amd64.
|
### Change "--autobuild=" to the specific kernel version you need: 6.12.22+bpo-amd64.
|
||||||
@@ -158,7 +162,7 @@ jobs:
|
|||||||
--ssh-port 42842 \
|
--ssh-port 42842 \
|
||||||
--ssh-pubkey /opt/config
|
--ssh-pubkey /opt/config
|
||||||
|
|
||||||
- name: Checking Centurion Cloud for existing LIVE ISOs.
|
- name: 📥 Checking Centurion Cloud for existing LIVE ISOs.
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
NC_BASE: "https://cloud.e2ee.li"
|
NC_BASE: "https://cloud.e2ee.li"
|
||||||
@@ -168,7 +172,7 @@ jobs:
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
SHARE_SUBDIR=""
|
SHARE_SUBDIR=""
|
||||||
|
|
||||||
echo "Get directory listing via PROPFIND ..."
|
echo "📥 Get directory listing via PROPFIND ..."
|
||||||
curl -s \
|
curl -s \
|
||||||
--user "${SHARE_TOKEN}:${SHARE_PASS}" \
|
--user "${SHARE_TOKEN}:${SHARE_PASS}" \
|
||||||
-X PROPFIND \
|
-X PROPFIND \
|
||||||
@@ -176,11 +180,11 @@ jobs:
|
|||||||
"${NC_BASE}/public.php/webdav/${SHARE_SUBDIR}" \
|
"${NC_BASE}/public.php/webdav/${SHARE_SUBDIR}" \
|
||||||
-o propfind_public.xml
|
-o propfind_public.xml
|
||||||
|
|
||||||
echo "Filter .iso files from the PROPFIND response ..."
|
echo "📥 Filter .iso files from the PROPFIND response ..."
|
||||||
grep -oP '(?<=<d:href>)[^<]+\.iso(?=</d:href>)' propfind_public.xml >| public_iso_list.txt || true
|
grep -oP '(?<=<d:href>)[^<]+\.iso(?=</d:href>)' propfind_public.xml >| public_iso_list.txt || true
|
||||||
|
|
||||||
if [[ -f public_iso_list.txt && -s public_iso_list.txt ]]; then
|
if [[ -f public_iso_list.txt && -s public_iso_list.txt ]]; then
|
||||||
echo "Old ISO files found and deleted :"
|
echo "ℹ️ Old ISO files found and deleted :"
|
||||||
while IFS= read -r href; do
|
while IFS= read -r href; do
|
||||||
FILE_URL="${NC_BASE}${href}"
|
FILE_URL="${NC_BASE}${href}"
|
||||||
echo " Delete: ${FILE_URL}"
|
echo " Delete: ${FILE_URL}"
|
||||||
@@ -193,16 +197,17 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done < public_iso_list.txt
|
done < public_iso_list.txt
|
||||||
else
|
else
|
||||||
echo "No old ISO files found to delete."
|
echo "ℹ️ No old ISO files found to delete."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload the ISO file to the Centurion Cloud (cloud.e2ee.li) via WebDAV.
|
- name: 🛠️ Upload the ISO file to the Centurion Cloud (cloud.e2ee.li) via WebDAV.
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
NC_BASE: "https://cloud.e2ee.li"
|
NC_BASE: "https://cloud.e2ee.li"
|
||||||
SHARE_TOKEN: "${{ secrets.CENTURION_CLOUD_UL_USER }}"
|
SHARE_TOKEN: "${{ secrets.CENTURION_CLOUD_UL_USER }}"
|
||||||
SHARE_PASS: "${{ secrets.CENTURION_CLOUD_UL_PASSWD }}"
|
SHARE_PASS: "${{ secrets.CENTURION_CLOUD_UL_PASSWD }}"
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
if [[ $(ls /opt/livebuild/*.iso 2>/dev/null | wc -l) -ne 1 ]]; then
|
if [[ $(ls /opt/livebuild/*.iso 2>/dev/null | wc -l) -ne 1 ]]; then
|
||||||
echo "❌ There must be exactly one .iso file in the directory!"
|
echo "❌ There must be exactly one .iso file in the directory!"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -221,7 +226,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Generating a sha512 Hash of ISO, signing with the 'CI PGP DEPLOY ONLY' key, generate a success message file.
|
- name: 🔑 Generating a sha512 Hash of ISO, signing with the 'CI PGP DEPLOY ONLY' key, generate a success message file.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [[ $(ls /opt/livebuild/*.iso 2>/dev/null | wc -l) -ne 1 ]]; then
|
if [[ $(ls /opt/livebuild/*.iso 2>/dev/null | wc -l) -ne 1 ]]; then
|
||||||
@@ -268,37 +273,75 @@ jobs:
|
|||||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=text
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=text
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Sync with remote before commit to avoid Job Race Conditions.
|
- name: 🔄 Sync with remote before commit using merge strategy.
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
GIT_SSH_COMMAND: "ssh -p 42842"
|
GIT_SSH_COMMAND: "ssh -p 42842"
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
export GNUPGHOME="$(pwd)/.gnupg"
|
export GNUPGHOME="$(pwd)/.gnupg"
|
||||||
|
|
||||||
|
echo "🔄 Fetching origin/master ..."
|
||||||
git fetch origin master
|
git fetch origin master
|
||||||
git rebase origin/master
|
|
||||||
|
echo "🔁 Merging origin/master into current branch ..."
|
||||||
|
git merge --no-edit origin/master || echo "✔️ Already up to date or fast-forward."
|
||||||
|
|
||||||
|
echo "📋 Post-merge status :"
|
||||||
git status
|
git status
|
||||||
git log --oneline -n 5
|
git log --oneline -n 5
|
||||||
|
|
||||||
- name: Stage generated files.
|
- name: 📦 Stage generated files.
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
GIT_SSH_COMMAND: "ssh -p 42842"
|
GIT_SSH_COMMAND: "ssh -p 42842"
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
PRIVATE_FILE="LIVE_ISO.private"
|
PRIVATE_FILE="LIVE_ISO.private"
|
||||||
git add "${PRIVATE_FILE}"
|
git add "${PRIVATE_FILE}" || echo "ℹ️ Nothing to add."
|
||||||
|
|
||||||
- name: Commit and Sign changes.
|
- name: 🔑 Commit and sign changes with CI metadata.
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
GIT_SSH_COMMAND: "ssh -p 42842"
|
GIT_SSH_COMMAND: "ssh -p 42842"
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
export GNUPGHOME="$(pwd)/.gnupg"
|
export GNUPGHOME="$(pwd)/.gnupg"
|
||||||
git commit -S -m "DEPLOY BOT: Auto-Generate LIVE ISO [skip ci]" || echo "No Changes, nothing to Sign or to Commit."
|
|
||||||
|
|
||||||
- name: Push back to Repository.
|
if git diff --cached --quiet; then
|
||||||
|
echo "ℹ️ No staged changes to commit."
|
||||||
|
else
|
||||||
|
echo "📝 Committing changes with GPG signature ..."
|
||||||
|
|
||||||
|
### CI Metadata
|
||||||
|
TIMESTAMP_UTC="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
||||||
|
HOSTNAME="$(hostname -f || hostname)"
|
||||||
|
GIT_SHA="$(git rev-parse --short HEAD)"
|
||||||
|
GIT_REF="$(git symbolic-ref --short HEAD || echo detached)"
|
||||||
|
WORKFLOW_ID="${GITHUB_WORKFLOW:-render-md-to-html.yaml}"
|
||||||
|
CI_HEADER="X-CI-Metadata: ${GIT_REF}@${GIT_SHA} at ${TIMESTAMP_UTC} on ${HOSTNAME}"
|
||||||
|
|
||||||
|
COMMIT_MSG="DEPLOY BOT: Auto-Generate PRIVATE LIVE ISO [skip ci]
|
||||||
|
|
||||||
|
${CI_HEADER}
|
||||||
|
|
||||||
|
Generated at: ${TIMESTAMP_UTC}
|
||||||
|
Runner Host : ${HOSTNAME}
|
||||||
|
Workflow ID : ${WORKFLOW_ID}
|
||||||
|
Git Commit : ${GIT_SHA} HEAD → ${GIT_REF}
|
||||||
|
"
|
||||||
|
|
||||||
|
echo "🔏 Commit message :"
|
||||||
|
echo "${COMMIT_MSG}"
|
||||||
|
git commit -S -m "${COMMIT_MSG}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 🔁 Push back to repository.
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
GIT_SSH_COMMAND: "ssh -p 42842"
|
GIT_SSH_COMMAND: "ssh -p 42842"
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
echo "📤 Pushing changes to ${GITHUB_REF_NAME} ..."
|
||||||
git push origin HEAD:${GITHUB_REF_NAME}
|
git push origin HEAD:${GITHUB_REF_NAME}
|
||||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=yaml
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=yaml
|
||||||
|
|||||||
@@ -30,9 +30,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Preparing SSH Setup, SSH Deploy Key, Known Hosts, .config.
|
- name: ⚙️ Preparing SSH Setup, SSH Deploy Key, Known Hosts, .config.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
|
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
|
||||||
|
|
||||||
### Private Key
|
### Private Key
|
||||||
@@ -61,18 +62,21 @@ jobs:
|
|||||||
### GITHUB_REF_NAME contains the branch name from the push event.
|
### GITHUB_REF_NAME contains the branch name from the push event.
|
||||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
git clone --branch "${GITHUB_REF_NAME}" ssh://git@git.coresecret.dev:42842/msw/CISS.debian.live.builder.git .
|
git clone --branch "${GITHUB_REF_NAME}" ssh://git@git.coresecret.dev:42842/msw/CISS.debian.live.builder.git .
|
||||||
git fetch --unshallow || echo "Nothing to fetch - already full clone."
|
git fetch --unshallow || echo "Nothing to fetch - already full clone."
|
||||||
|
|
||||||
- name: 🛠️ Cleaning the workspace.
|
- name: 🛠️ Cleaning the workspace.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
git reset --hard
|
git reset --hard
|
||||||
git clean -fd
|
git clean -fd
|
||||||
|
|
||||||
- name: ⚙️ Importing the 'CI PGP DEPLOY ONLY' key.
|
- name: ⚙️ Importing the 'CI PGP DEPLOY ONLY' key.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
### GPG-Home relative to the Runner Workspace to avoid changing global files.
|
### GPG-Home relative to the Runner Workspace to avoid changing global files.
|
||||||
export GNUPGHOME="$(pwd)/.gnupg"
|
export GNUPGHOME="$(pwd)/.gnupg"
|
||||||
mkdir -m 700 "${GNUPGHOME}"
|
mkdir -m 700 "${GNUPGHOME}"
|
||||||
@@ -85,6 +89,7 @@ jobs:
|
|||||||
- name: ⚙️ Configuring Git for signed CI/DEPLOY commits.
|
- name: ⚙️ Configuring Git for signed CI/DEPLOY commits.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
export GNUPGHOME="$(pwd)/.gnupg"
|
export GNUPGHOME="$(pwd)/.gnupg"
|
||||||
git config user.name "Marc S. Weidner BOT"
|
git config user.name "Marc S. Weidner BOT"
|
||||||
git config user.email "msw+bot@coresecret.dev"
|
git config user.email "msw+bot@coresecret.dev"
|
||||||
@@ -95,12 +100,14 @@ jobs:
|
|||||||
- name: ⚙️ Convert APT sources to HTTPS.
|
- name: ⚙️ Convert APT sources to HTTPS.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
sed -i 's|http://\(archive\.ubuntu\.com\|security\.ubuntu\.com\)|https://\1|g' /etc/apt/sources.list
|
sed -i 's|http://\(archive\.ubuntu\.com\|security\.ubuntu\.com\)|https://\1|g' /etc/apt/sources.list
|
||||||
sed -i 's|http://\(archive\.ubuntu\.com\|security\.ubuntu\.com\)|https://\1|g' /etc/apt/sources.list.d/*.list || true
|
sed -i 's|http://\(archive\.ubuntu\.com\|security\.ubuntu\.com\)|https://\1|g' /etc/apt/sources.list.d/*.list || true
|
||||||
|
|
||||||
- name: 🛠️Install Pandoc & Dependencies.
|
- name: 🛠️ Install Pandoc & Dependencies.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y pandoc
|
sudo apt-get install -y pandoc
|
||||||
|
|
||||||
@@ -112,6 +119,7 @@ jobs:
|
|||||||
#- name: Render *.md to full standalone HTML.
|
#- name: Render *.md to full standalone HTML.
|
||||||
# shell: bash
|
# shell: bash
|
||||||
# run: |
|
# run: |
|
||||||
|
# set -euo pipefail
|
||||||
# find . \( -path "*/.*" -prune \) -o -type f -name "*.md" -print | while read file; do
|
# find . \( -path "*/.*" -prune \) -o -type f -name "*.md" -print | while read file; do
|
||||||
# out=$(basename "${file%.md}.html")
|
# out=$(basename "${file%.md}.html")
|
||||||
# pandoc -s "${file}" \
|
# pandoc -s "${file}" \
|
||||||
@@ -129,6 +137,7 @@ jobs:
|
|||||||
- name: 📥 Extract HTML fragment for Gitea for *.md.
|
- name: 📥 Extract HTML fragment for Gitea for *.md.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
find . \( -path "*/.*" -prune \) -o -type f -name "README.md" -print | while read file; do
|
find . \( -path "*/.*" -prune \) -o -type f -name "README.md" -print | while read file; do
|
||||||
out="${file%.md}.html"
|
out="${file%.md}.html"
|
||||||
pandoc "${file}" \
|
pandoc "${file}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user