Files
openssh-deb/.github/workflows/create-release.yml
boypt 408fc63800 feat: add Ubuntu 18.04 (bionic) backport support
compile.sh:
- drop libcrypt-dev build-dep when absent (crypt.h in libc6-dev)
- strip runit integration when dh-runit constraint is unsatisfiable
  (avoids uninstallable runit-helper >= 2.17 dep)
- rewrite sysusers named-GID syntax for systemd < 244 (237 cannot
  parse 'u sshd -:nogroup', sshd privsep user was never created)
- install systemd units to /lib on non-merged-usr distros
  (deb-systemd-helper 1.51 only searches /lib/systemd/system)

install_deps.sh:
- install ca-certificates (fixes GitHub TLS verification in pullsrc)
- install libcrypt-dev when available in the archive
- pull dwz from <codename>-backports when too old for debhelper 13.14
- patch debhelper 13.14 for Perl 5.26 (list-context state, dh_missing)
- lower init-system-helpers dep versions and drop
  --skip-systemd-native from invoke-rc.d calls on old distros
- keep dh_installsystemd unit path at /lib on non-merged-usr

CI: add ubuntu:bionic to both workflow matrices
2026-08-31 18:20:04 +08:00

115 lines
3.5 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"]
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@v3
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 "apt update && 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