Files
Pascal LinxweilerandClaude Opus 5.5 a756eb3794 Release workflow: drop setup-node's npm cache
The act_runner cache server isn't reachable from job containers
(getCacheEntry ETIMEDOUT), so restoring and saving the cache timed out
for ~4.5 min each, ~9 of the ~12 minutes per release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 01:30:25 +02:00

65 lines
2.4 KiB
YAML

# Push a tag vX.Y.Z (matching package.json) → checks, Docker image to the Gitea registry, release.
#
# Needs: an act_runner with access to a Docker daemon (default config mounts the socket),
# and a repo secret REGISTRY_TOKEN (personal access token with package read+write).
name: Release
on:
push:
tags: ["v*.*.*"]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# No `cache: npm`: the runner's cache server isn't reachable from job containers here, and the
# restore + save timeouts cost ~9 minutes per run. `npm ci` alone takes ~20 s.
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Resolve version and image name
run: |
VERSION="${GITHUB_REF_NAME#v}"
PKG_VERSION="$(node -p "require('./package.json').version")"
if [ "$VERSION" != "$PKG_VERSION" ]; then
echo "::error::Tag $GITHUB_REF_NAME does not match package.json version $PKG_VERSION"
exit 1
fi
node scripts/release-notes.mjs notes "$VERSION" > /dev/null
REGISTRY="${GITHUB_SERVER_URL#https://}"
IMAGE="$(echo "$REGISTRY/$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]')"
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
echo "REGISTRY=$REGISTRY" >> "$GITHUB_ENV"
echo "IMAGE=$IMAGE" >> "$GITHUB_ENV"
echo "Building $IMAGE:$VERSION"
- name: Checks
run: |
npm ci
npm run lint
npm run typecheck
npm test
- name: Build image
run: |
docker build \
--build-arg APP_VERSION="$VERSION" \
--label org.opencontainers.image.version="$VERSION" \
--label org.opencontainers.image.revision="$GITHUB_SHA" \
--label org.opencontainers.image.source="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
-t "$IMAGE:$VERSION" -t "$IMAGE:${VERSION%.*}" -t "$IMAGE:latest" .
- name: Push image
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ github.repository_owner }}" --password-stdin
for tag in "$VERSION" "${VERSION%.*}" latest; do docker push "$IMAGE:$tag"; done
docker logout "$REGISTRY"
- name: Create release
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node scripts/release-notes.mjs publish