Files
openssh-deb/.github/workflows/create-amd64-release.yml
2025-04-22 15:21:39 +08:00

242 lines
8.5 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: Create amd64 release
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
tags: [ "v*" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build_ubuntu24:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v4
- name: "Compile Ubuntu 24.04 (noble) [amd64]"
run: |
docker run --rm -v ${{ github.workspace }}:/work library/ubuntu:24.04 -w /work bash -c "./install_deps.sh && ./compile.sh"
sudo apt install -y rename
source ${{ github.workspace }}/version.env
pushd ${{ github.workspace }}/output
sudo rename "s/$OPENSSH_SIDPKG/$OPENSSH_SIDPKG-noble/" *.deb
popd
- uses: actions/upload-artifact@v4
with:
name: ubuntu24-amd64
path: ${{ github.workspace }}/output
build_ubuntu22:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Not available now, lack of package `dh-sequence-movetousr`
continue-on-error: true
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v4
- name: "Compile Ubuntu 22.04 (jammy) [amd64]"
run: |
docker run --rm -v ${{ github.workspace }}:/work library/ubuntu:22.04 -w /work bash -c "./install_deps.sh && ./compile.sh"
sudo apt install -y rename
source ${{ github.workspace }}/version.env
pushd ${{ github.workspace }}/output
sudo rename "s/$OPENSSH_SIDPKG/$OPENSSH_SIDPKG-jammy/" *.deb
popd
- uses: actions/upload-artifact@v4
with:
name: ubuntu22-amd64
path: ${{ github.workspace }}/output
build_ubuntu20:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v4
- name: "Compile Ubuntu 20.04 (focal) [amd64]"
run: |
docker run --rm -v ${{ github.workspace }}:/work library/ubuntu:20.04 -w /work bash -c "./install_deps.sh && ./compile.sh"
sudo apt install -y rename
source ${{ github.workspace }}/version.env
pushd ${{ github.workspace }}/output
sudo rename "s/$OPENSSH_SIDPKG/$OPENSSH_SIDPKG-focal/" *.deb
popd
- uses: actions/upload-artifact@v4
with:
name: ubuntu20-amd64
path: ${{ github.workspace }}/output
build_ubuntu18:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v4
- name: "Compile Ubuntu 18.04 (bionic) [amd64]"
run: |
docker run --rm -v ${{ github.workspace }}:/work library/ubuntu:18.04 -w /work bash -c "./install_deps.sh && ./compile.sh"
sudo apt install -y rename
source ${{ github.workspace }}/version.env
pushd ${{ github.workspace }}/output
sudo rename "s/$OPENSSH_SIDPKG/$OPENSSH_SIDPKG-bionic/" *.deb
popd
- uses: actions/upload-artifact@v4
with:
name: ubuntu18-amd64
path: ${{ github.workspace }}/output
build_debian13:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v4
- name: "Compile Debian 13 (trixie) [amd64]"
run: |
docker run --rm -v ${{ github.workspace }}:/work library/debian:trixie -w /work bash -c "./install_deps.sh && ./compile.sh"
sudo apt install -y rename
source ${{ github.workspace }}/version.env
pushd ${{ github.workspace }}/output
sudo rename "s/$OPENSSH_SIDPKG/$OPENSSH_SIDPKG-trixie/" *.deb
popd
- uses: actions/upload-artifact@v4
with:
name: debian13-amd64
path: ${{ github.workspace }}/output
build_debian12:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Not available now, lack of package `dh-sequence-movetousr`
continue-on-error: true
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v4
- name: "Compile Debian 12 (bookworm) [amd64]"
run: |
docker run --rm -v ${{ github.workspace }}:/work library/debian:bookworm -w /work bash -c "./install_deps.sh && ./compile.sh"
sudo apt install -y rename
source ${{ github.workspace }}/version.env
pushd ${{ github.workspace }}/output
sudo rename "s/$OPENSSH_SIDPKG/$OPENSSH_SIDPKG-bookworm/" *.deb
popd
- uses: actions/upload-artifact@v4
with:
name: debian12-amd64
path: ${{ github.workspace }}/output
build_debian11:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Not available now, lack of package `dh-sequence-movetousr`
continue-on-error: true
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v4
- name: "Compile Debian 11 (bullseye) [amd64]"
run: |
docker run --rm -v ${{ github.workspace }}:/work library/debian:bullseye -w /work bash -c "./install_deps.sh && ./compile.sh"
sudo apt install -y rename
source ${{ github.workspace }}/version.env
pushd ${{ github.workspace }}/output
sudo rename "s/$OPENSSH_SIDPKG/$OPENSSH_SIDPKG-bullseye/" *.deb
popd
- uses: actions/upload-artifact@v4
with:
name: debian11-amd64
path: ${{ github.workspace }}/output
create_release:
needs:
- build_ubuntu24
- build_ubuntu22
- build_ubuntu20
- build_ubuntu18
- build_debian13
- build_debian12
- build_debian11
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ubuntu24-amd64
path: ./output
- uses: actions/download-artifact@v4
with:
name: ubuntu22-amd64
path: ./output
- uses: actions/download-artifact@v4
with:
name: ubuntu20-amd64
path: ./output
- uses: actions/download-artifact@v4
with:
name: ubuntu18-amd64
path: ./output
- uses: actions/download-artifact@v4
with:
name: debian13-amd64
path: ./output
- uses: actions/download-artifact@v4
with:
name: debian12-amd64
path: ./output
- uses: actions/download-artifact@v4
with:
name: debian11-amd64
path: ./output
- 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/*"
bodyFile: ${{ github.workspace }}/RELEASE.md
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true