Files
openssh-deb/.github/workflows/create-release.yml
boypt b7a01f8a74 ci: upgrade docker actions to Node24 and fix bullseye archive 404
- docker/setup-buildx-action v3->v4, docker/login-action v3->v4,
  docker/build-push-action v5->v7 to eliminate Node.js 20 deprecated
  warnings (Node 24 runtime, requires runner >=2.327.1)
  actions/checkout@v5, upload-artifact@v7, download-artifact@v7,
  ncipollo/release-action@v1 already node24 -> keep

- install_deps.sh: fix bullseye EOL handling that caused
  'archive.debian.org/debian-security bullseye-security 404' in
  Build and Push Dependency Images (continously failing since 82d0f3f):
  robust _probe_url (wget->curl->python3 fallback, both Release/InRelease),
  keep official source when reachable, and when falling back to archive
  verify archive security exists else revert security to deb.debian.org
  (keeps bullseye/main on archive, security on official until archive ready)
2026-09-01 16:18:03 +08:00

119 lines
3.7 KiB
YAML
Executable File

name: Create release
on:
push:
tags: [ "v*" ]
workflow_dispatch:
permissions:
contents: write
packages: read
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
version: ["ubuntu:noble", "ubuntu:jammy", "ubuntu:focal", "ubuntu:bionic", "debian:trixie", "debian:bookworm", "debian:bullseye", "debian:buster"]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
persist-credentials: false
- name: Set image tag
id: vars
run: |
CODENAME=$(echo "${{ matrix.version }}" | cut -d':' -f2)
ARCH="amd64"
[[ "${{ matrix.os }}" == *arm* ]] && ARCH="arm64"
echo "arch=${ARCH}" >> $GITHUB_OUTPUT
echo "codename=${CODENAME}" >> $GITHUB_OUTPUT
echo "image=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:deps-${CODENAME}-${ARCH}" >> $GITHUB_OUTPUT
- name: Log in to Container Registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull prebuilt dependency image
run: docker pull ${{ steps.vars.outputs.image }}
- name: Compile ${{ matrix.version }} on ${{ matrix.os }}
run: |
./pullsrc.sh
docker run --rm -v ${{ github.workspace }}:/work -w /work ${{ steps.vars.outputs.image }} bash -c "./compile.sh"
- name: Install test with ${{ matrix.version }}
run: |
docker run --rm -v ${{ github.workspace }}:/work -w /work library/${{ matrix.version }} bash -c "
# EOL archive fix via install_deps.sh --fix-apt-only
bash /work/install_deps.sh --fix-apt-only &&
apt update -qq >/dev/null 2>&1 &&
apt install -y --no-install-recommends ./output/*.deb && ssh -V"
- name: Pack .deb files into tar.gz
id: pack
run: |
TAG_NAME="${{ github.ref_name }}"
CODENAME=$(echo "${{ matrix.version }}" | cut -d':' -f2)
ARCH="amd64"
[[ "${{ matrix.os }}" == *arm* ]] && ARCH="arm64"
cd ${{ github.workspace }}/output
tar -cvzf ../openssh-${TAG_NAME}-${CODENAME}-${ARCH}.tar.gz *.deb
SAFE_VERSION=$(echo "${{ matrix.version }}" | sed 's/:/-/g')
echo "artifact_name=${SAFE_VERSION}-${ARCH}" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: upload-${{ steps.pack.outputs.artifact_name }}
path: ${{ github.workspace }}/openssh-*.tar.gz
create_release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
persist-credentials: false
- name: Download all archives
uses: actions/download-artifact@v7
with:
path: ./output
merge-multiple: true
- name: Get tag message
run: |
echo -e "> Automated release created by GitHub Actions.\n" > ${{ github.workspace }}/RELEASE.md
GITHUB_REF=${{ github.ref }}
TAG_NAME="${GITHUB_REF#refs/tags/}"
git tag -l --format='%(contents)' "${TAG_NAME}" | tee -a ${{ github.workspace }}/RELEASE.md
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
artifacts: "${{ github.workspace }}/output/*.tar.gz"
bodyFile: ${{ github.workspace }}/RELEASE.md
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true