Some checks failed
Check for Upstream Stable Updates / Rebuild and push all variants (apko/dotnet-runtime.yaml, dotnet-runtime) (push) Blocked by required conditions
Check for Upstream Stable Updates / Rebuild and push all variants (apko/dotnet-sdk.yaml, dotnet-sdk) (push) Blocked by required conditions
Check for Upstream Stable Updates / Rebuild and push all variants (apko/flutter-sdk.yaml, flutter-sdk) (push) Blocked by required conditions
Check for Upstream Stable Updates / Create release for new Flutter version (push) Blocked by required conditions
Build and Push Base Distro Images / build-and-push (apko/base.yaml, base) (push) Successful in 40s
Build and Push Base Distro Images / build-and-push (apko/build.yaml, build) (push) Successful in 43s
Build and Push Base Distro Images / build-and-push (apko/dotnet-runtime.yaml, dotnet-runtime) (push) Successful in 49s
Build and Push Base Distro Images / build-and-push (apko/dotnet-sdk.yaml, dotnet-sdk) (push) Successful in 1m5s
Build and Push Base Distro Images / build-and-push (apko/flutter-sdk.yaml, flutter-sdk) (push) Successful in 40s
Weekly Rebuild (CVE Updates) / rebuild (apko/base.yaml, base) (push) Successful in 40s
Weekly Rebuild (CVE Updates) / rebuild (apko/build.yaml, build) (push) Successful in 43s
Weekly Rebuild (CVE Updates) / rebuild (apko/dotnet-runtime.yaml, dotnet-runtime) (push) Successful in 37s
Weekly Rebuild (CVE Updates) / rebuild (apko/dotnet-sdk.yaml, dotnet-sdk) (push) Successful in 41s
Weekly Rebuild (CVE Updates) / rebuild (apko/flutter-sdk.yaml, flutter-sdk) (push) Successful in 55s
Check for Upstream Stable Updates / Check Wolfi package updates (push) Successful in 27s
Check for Upstream Stable Updates / Check .NET stable releases (push) Successful in 1s
Check for Upstream Stable Updates / Check Flutter stable releases (push) Successful in 1s
Check for Upstream Stable Updates / Rebuild and push all variants (apko/base.yaml, base) (push) Has been cancelled
Check for Upstream Stable Updates / Rebuild and push all variants (apko/build.yaml, build) (push) Has been cancelled
Gitea drops the second ${{ env.APKO_VERSION }} expansion when multiple
expressions appear on the same line. Assigning to a shell variable
first avoids the bug.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
249 lines
9.8 KiB
YAML
249 lines
9.8 KiB
YAML
name: Check for Upstream Stable Updates
|
|
|
|
on:
|
|
schedule:
|
|
# Daily at 8am UTC
|
|
- cron: '0 8 * * *'
|
|
push:
|
|
paths:
|
|
- '.gitea/workflows/update-check.yaml'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
IMAGE_NAME: base-distro
|
|
APKO_VERSION: 1.1.2
|
|
|
|
jobs:
|
|
check-wolfi:
|
|
name: Check Wolfi package updates
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
updated: ${{ steps.check.outputs.updated }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install apko
|
|
run: |
|
|
APKO_ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
|
|
APKO_VER="${{ env.APKO_VERSION }}"
|
|
curl -fsSL "https://github.com/chainguard-dev/apko/releases/download/v${APKO_VER}/apko_${APKO_VER}_linux_${APKO_ARCH}.tar.gz" \
|
|
-o /tmp/apko.tar.gz
|
|
tar xzf /tmp/apko.tar.gz --strip-components=1 -C /usr/local/bin
|
|
rm /tmp/apko.tar.gz
|
|
|
|
- name: Check for Wolfi package updates
|
|
id: check
|
|
run: |
|
|
# Resolve current packages for each variant and compare with last known state
|
|
UPDATED=false
|
|
|
|
for config in apko/base.yaml apko/build.yaml apko/dotnet-runtime.yaml apko/dotnet-sdk.yaml apko/flutter-sdk.yaml; do
|
|
VARIANT=$(basename "$config" .yaml)
|
|
echo "Checking $VARIANT..."
|
|
|
|
# Resolve package versions (dry-run build to see resolved versions)
|
|
RESOLVED=$(apko resolve "$config" 2>&1 || true)
|
|
HASH=$(echo "$RESOLVED" | sha256sum | cut -d' ' -f1)
|
|
|
|
echo "$VARIANT=$HASH" >> "$GITHUB_OUTPUT"
|
|
echo " Hash: $HASH"
|
|
done
|
|
|
|
echo "updated=$UPDATED" >> "$GITHUB_OUTPUT"
|
|
|
|
check-dotnet:
|
|
name: Check .NET stable releases
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
new_version: ${{ steps.check.outputs.new_version }}
|
|
current_version: ${{ steps.check.outputs.current_version }}
|
|
steps:
|
|
- name: Check latest .NET stable release
|
|
id: check
|
|
run: |
|
|
# Query the .NET release metadata for the latest stable SDK
|
|
LATEST=$(curl -fsSL "https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json" \
|
|
| jq -r '[."releases-index"[] | select(."support-phase" == "active" or ."support-phase" == "go-live") | ."latest-sdk"] | sort_by(. | split(".") | map(tonumber)) | last')
|
|
|
|
echo "Latest .NET stable SDK: $LATEST"
|
|
echo "new_version=$LATEST" >> "$GITHUB_OUTPUT"
|
|
|
|
# Check if we already have a rebuild tag for this version
|
|
CURRENT_TAG="${LATEST}"
|
|
echo "current_version=$CURRENT_TAG" >> "$GITHUB_OUTPUT"
|
|
|
|
check-flutter:
|
|
name: Check Flutter stable releases
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
new_version: ${{ steps.check.outputs.new_version }}
|
|
has_new: ${{ steps.check.outputs.has_new }}
|
|
steps:
|
|
- name: Check latest Flutter stable release
|
|
id: check
|
|
run: |
|
|
LATEST=$(curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json" \
|
|
| jq -r '.current_release.stable as $hash | .releases[] | select(.hash == $hash and .channel == "stable") | .version')
|
|
|
|
echo "Latest Flutter stable: $LATEST"
|
|
echo "new_version=$LATEST" >> "$GITHUB_OUTPUT"
|
|
|
|
# Check if a release with this tag already exists (unauthenticated, HTTP status only)
|
|
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
|
|
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/tags/v${LATEST}")
|
|
|
|
if [ "$STATUS" = "200" ]; then
|
|
echo "Release v${LATEST} already exists, skipping"
|
|
echo "has_new=false" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "New Flutter stable version found: $LATEST"
|
|
echo "has_new=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
rebuild:
|
|
name: Rebuild and push all variants
|
|
needs: [check-wolfi, check-dotnet, check-flutter]
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- config: apko/base.yaml
|
|
variant: base
|
|
- config: apko/build.yaml
|
|
variant: build
|
|
- config: apko/dotnet-runtime.yaml
|
|
variant: dotnet-runtime
|
|
- config: apko/dotnet-sdk.yaml
|
|
variant: dotnet-sdk
|
|
- config: apko/flutter-sdk.yaml
|
|
variant: flutter-sdk
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install apko
|
|
run: |
|
|
APKO_ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
|
|
APKO_VER="${{ env.APKO_VERSION }}"
|
|
curl -fsSL "https://github.com/chainguard-dev/apko/releases/download/v${APKO_VER}/apko_${APKO_VER}_linux_${APKO_ARCH}.tar.gz" \
|
|
-o /tmp/apko.tar.gz
|
|
tar xzf /tmp/apko.tar.gz --strip-components=1 -C /usr/local/bin
|
|
rm /tmp/apko.tar.gz
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Determine upstream version
|
|
id: version
|
|
run: |
|
|
VARIANT="${{ matrix.variant }}"
|
|
|
|
case "$VARIANT" in
|
|
base|build)
|
|
UPSTREAM=$(apko resolve ${{ matrix.config }} 2>&1 | grep -oP 'glibc-\K[0-9]+\.[0-9]+' | head -1 || echo "0.0")
|
|
if [ "$UPSTREAM" = "" ] || [ "$UPSTREAM" = "0.0" ]; then
|
|
UPSTREAM=$(apko resolve ${{ matrix.config }} 2>&1 | grep -oP 'glibc \(\K[0-9]+\.[0-9]+' | head -1 || echo "2.42")
|
|
fi
|
|
;;
|
|
dotnet-runtime)
|
|
UPSTREAM=$(curl -fsSL "https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json" \
|
|
| jq -r '[."releases-index"[] | select(."support-phase" == "active" or ."support-phase" == "go-live") | ."latest-runtime"] | sort_by(. | split(".") | map(tonumber)) | last')
|
|
;;
|
|
dotnet-sdk)
|
|
UPSTREAM=$(curl -fsSL "https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json" \
|
|
| jq -r '[."releases-index"[] | select(."support-phase" == "active" or ."support-phase" == "go-live") | ."latest-sdk"] | sort_by(. | split(".") | map(tonumber)) | last')
|
|
;;
|
|
flutter-sdk)
|
|
UPSTREAM=$(curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json" \
|
|
| jq -r '.current_release.stable as $hash | .releases[] | select(.hash == $hash and .channel == "stable") | .version')
|
|
;;
|
|
esac
|
|
|
|
echo "upstream=${UPSTREAM}" >> "$GITHUB_OUTPUT"
|
|
echo "Upstream version for ${VARIANT}: ${UPSTREAM}"
|
|
|
|
REPO_NAME="${{ env.IMAGE_NAME }}"
|
|
REGISTRY_URL="${{ secrets.REGISTRY_URL }}"
|
|
NAMESPACE=$(echo "$REGISTRY_URL" | sed 's|.*://||; s|.*\.io/||; s|/$||')
|
|
|
|
EXISTING_TAGS=$(curl -s "https://hub.docker.com/v2/repositories/${NAMESPACE}/${REPO_NAME}/tags?page_size=100&name=${VARIANT}-${UPSTREAM}." \
|
|
| jq -r '.results[]?.name // empty' 2>/dev/null || echo "")
|
|
|
|
MAX_BUILD=0
|
|
for tag in $EXISTING_TAGS; do
|
|
BUILD_NUM=$(echo "$tag" | grep -oP "\.\K[0-9]+$" || echo "0")
|
|
if [ "$BUILD_NUM" -gt "$MAX_BUILD" ] 2>/dev/null; then
|
|
MAX_BUILD=$BUILD_NUM
|
|
fi
|
|
done
|
|
|
|
NEXT_BUILD=$((MAX_BUILD + 1))
|
|
VERSION_TAG="${VARIANT}-${UPSTREAM}.${NEXT_BUILD}"
|
|
echo "version_tag=${VERSION_TAG}" >> "$GITHUB_OUTPUT"
|
|
echo "Next version tag: ${VERSION_TAG}"
|
|
|
|
- name: Build apko image tarball
|
|
run: |
|
|
apko build ${{ matrix.config }} \
|
|
${{ secrets.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ matrix.variant }}-latest \
|
|
/tmp/image.tar
|
|
echo 'FROM scratch' > /tmp/Dockerfile
|
|
echo 'ADD image.tar /' >> /tmp/Dockerfile
|
|
echo 'USER 65532' >> /tmp/Dockerfile
|
|
|
|
- name: Build and push with buildx (SBOM + provenance)
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: /tmp
|
|
file: /tmp/Dockerfile
|
|
push: true
|
|
sbom: true
|
|
provenance: mode=max
|
|
tags: |
|
|
${{ secrets.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ matrix.variant }}-latest
|
|
${{ secrets.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version_tag }}
|
|
|
|
- name: Install Docker Scout
|
|
run: |
|
|
curl -fsSL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh -o install-scout.sh
|
|
sh install-scout.sh
|
|
|
|
- name: Docker Scout CVE Scan
|
|
run: |
|
|
docker pull ${{ secrets.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ matrix.variant }}-latest
|
|
docker scout cves ${{ secrets.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ matrix.variant }}-latest --only-severity critical,high
|
|
|
|
notify-flutter:
|
|
name: Create release for new Flutter version
|
|
needs: [check-flutter]
|
|
if: needs.check-flutter.outputs.has_new == 'true'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Create Gitea release
|
|
run: |
|
|
VERSION="${{ needs.check-flutter.outputs.new_version }}"
|
|
echo "Creating release v${VERSION} for new Flutter stable..."
|
|
|
|
curl -fsSL -X POST \
|
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
-H "Content-Type: application/json" \
|
|
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases" \
|
|
-d "{
|
|
\"tag_name\": \"v${VERSION}\",
|
|
\"name\": \"v${VERSION} - Flutter ${VERSION}\",
|
|
\"body\": \"Automated release triggered by Flutter stable ${VERSION} detection.\n\nUpstream: https://docs.flutter.dev/release/release-notes\",
|
|
\"draft\": false,
|
|
\"prerelease\": false
|
|
}"
|
|
|
|
echo "Release v${VERSION} created successfully"
|