Added versioning information to footer of website. General updates to the release action
Some checks failed
Changelog + Release on main / changelog_and_release (push) Failing after 6m47s

Signed-off-by: Alexander Lyall <alex@adcm.uk>
This commit is contained in:
2026-03-21 22:04:49 +00:00
parent 535c62b838
commit 5d23d0639e
2 changed files with 77 additions and 19 deletions

View File

@@ -91,27 +91,11 @@ jobs:
head -n 60 RELEASE_NOTES.md head -n 60 RELEASE_NOTES.md
echo "--------------------------" echo "--------------------------"
- name: Create export zip (Computing:Box Website.zip)
shell: bash
run: |
set -e
if [ ! -d "dist" ]; then
echo "❌ dist/ folder not found in repo root"
ls -la
exit 1
fi
rm -f "Computing:Box Website.zip"
(cd dist && zip -r "../Computing:Box Website.zip" .)
test -s "Computing:Box Website.zip"
ls -lh "Computing:Box Website.zip"
- name: Prepare YY.MM.DD letter-suffix tag + release name - name: Prepare YY.MM.DD letter-suffix tag + release name
shell: bash shell: bash
run: | run: |
set -e set -e
# Version: YY.MM.DD (UTC). Swap to `date +...` if you prefer UK-local runner time.
VERSION="$(date -u +'%y.%m.%d')" VERSION="$(date -u +'%y.%m.%d')"
PREFIX="v${VERSION}." PREFIX="v${VERSION}."
@@ -135,12 +119,77 @@ jobs:
TAG="${PREFIX}${next_letter}" TAG="${PREFIX}${next_letter}"
RELEASE_NAME="Computing:Box v${VERSION}.${next_letter}" RELEASE_NAME="Computing:Box v${VERSION}.${next_letter}"
origin_url="$(git remote get-url origin)"
if echo "$origin_url" | grep -q "^git@"; then
host="$(echo "$origin_url" | sed -E 's#git@([^:]+):.*#\1#')"
path="$(echo "$origin_url" | sed -E 's#git@[^:]+:(.*)#\1#')"
origin_url="https://$host/$path"
fi
base="$(echo "$origin_url" | sed -E 's#(https?://[^/]+)/.*#\1#')"
repo_path="$(echo "$origin_url" | sed -E 's#https?://[^/]+/##')"
repo_path="$(echo "$repo_path" | sed -E 's/\.git$//')"
RELEASE_URL="${base}/${repo_path}/releases/tag/${TAG}"
echo "TAG=$TAG" >> "$GITHUB_ENV" echo "TAG=$TAG" >> "$GITHUB_ENV"
echo "RELEASE_NAME=$RELEASE_NAME" >> "$GITHUB_ENV" echo "RELEASE_NAME=$RELEASE_NAME" >> "$GITHUB_ENV"
echo "ZIP_PATH=Computing:Box Website.zip" >> "$GITHUB_ENV" echo "ZIP_PATH=Computing:Box Website.zip" >> "$GITHUB_ENV"
echo "RELEASE_URL=$RELEASE_URL" >> "$GITHUB_ENV"
echo "Using tag: $TAG" echo "Using tag: $TAG"
echo "Release name: $RELEASE_NAME" echo "Release name: $RELEASE_NAME"
echo "Release URL: $RELEASE_URL"
- name: Generate version file for Astro footer
shell: bash
run: |
set -e
mkdir -p src/generated
cat > src/generated/version.json <<EOF
{
"version": "${TAG}",
"url": "${RELEASE_URL}"
}
EOF
echo "Generated src/generated/version.json"
cat src/generated/version.json
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
shell: bash
run: |
set -e
npm ci
- name: Build Astro site
shell: bash
run: |
set -e
npm run build
test -d dist
- name: Create export zip (Computing:Box Website.zip)
shell: bash
run: |
set -e
if [ ! -d "dist" ]; then
echo "❌ dist/ folder not found in repo root"
ls -la
exit 1
fi
rm -f "Computing:Box Website.zip"
(cd dist && zip -r "../Computing:Box Website.zip" .)
test -s "Computing:Box Website.zip"
ls -lh "Computing:Box Website.zip"
- name: Create and push tag (CHANGELOG_PAT) - name: Create and push tag (CHANGELOG_PAT)
shell: bash shell: bash
@@ -153,7 +202,6 @@ jobs:
origin_url="$(git remote get-url origin)" origin_url="$(git remote get-url origin)"
# Convert SSH origin to HTTPS if needed
if echo "$origin_url" | grep -q "^git@"; then if echo "$origin_url" | grep -q "^git@"; then
host="$(echo "$origin_url" | sed -E 's#git@([^:]+):.*#\1#')" host="$(echo "$origin_url" | sed -E 's#git@([^:]+):.*#\1#')"
path="$(echo "$origin_url" | sed -E 's#git@[^:]+:(.*)#\1#')" path="$(echo "$origin_url" | sed -E 's#git@[^:]+:(.*)#\1#')"
@@ -198,7 +246,7 @@ jobs:
"tag_name": tag, "tag_name": tag,
"target_commitish": "main", "target_commitish": "main",
"name": name, "name": name,
"body": body, # newest section only "body": body,
"draft": False, "draft": False,
"prerelease": False, "prerelease": False,
} }

View File

@@ -1,5 +1,9 @@
--- ---
import "../styles/global.css"; import "../styles/global.css";
import versionInfo from "../generated/version.json";
const version = versionInfo.version;
const releaseUrl = versionInfo.url;
const { title = "Computing:Box" } = Astro.props; const { title = "Computing:Box" } = Astro.props;
--- ---
@@ -60,6 +64,12 @@ const { title = "Computing:Box" } = Astro.props;
<a href="/legal-code" style="margin-left: 32px; color: var(--muted); text-decoration: underline;">Legal Code</a> <a href="/legal-code" style="margin-left: 32px; color: var(--muted); text-decoration: underline;">Legal Code</a>
</div> </div>
<div>Computer Science Concept Simulators</div> <div>Computer Science Concept Simulators</div>
<div>
Version:
<a href={releaseUrl} target="_blank" rel="noopener noreferrer">
{version}
</a>
</div>
<div>© {new Date().getFullYear()} Computing:Box • Created with ♥ by Mr A Lyall</div> <div>© {new Date().getFullYear()} Computing:Box • Created with ♥ by Mr A Lyall</div>
</div> </div>
</footer> </footer>