Release workflows: a minimal set for a release of the development branch
Some checks are pending
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Waiting to run

A release whose tree has DEVEL and no RELEASE is one of the development
branch (release-kind.yml, called by the workflows below). For it only
the Windows x64 zip, the x86_64 and arm64 deb packages and the rpm for
EL 9 and 10 (x86_64 and arm64) are built and added to the release: no
Docker images, no source tarball, no ipk, armhf, watcom, win32 or
Windows arm64 builds. docker.yml makes it a prerelease, not "Latest",
which also keeps it out of the package repository 3proxy.github.io
builds from releases.

The packaging reads the version from RELEASE or DEVEL. rpm names the
source archive and its directory after the spec's Version, which for
2.0.0-devel is 2.0.0~devel, so that %setup finds it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vladimir Dubrovin 2026-10-23 20:10:59 +03:00
parent 7fab9c488d
commit 9ce5de971f
11 changed files with 135 additions and 17 deletions

View File

@ -12,7 +12,13 @@ env:
OPENWRT_RELEASE: 24.10.0 OPENWRT_RELEASE: 24.10.0
jobs: jobs:
kind:
uses: ./.github/workflows/release-kind.yml
ipk: ipk:
# not for a release of the development branch
needs: kind
if: github.event_name != 'release' || needs.kind.outputs.devel != 'true'
permissions: permissions:
contents: write contents: write
id-token: write id-token: write

View File

@ -25,7 +25,19 @@ jobs:
- name: env - name: env
run: | run: |
pwd pwd
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV # a release branch has RELEASE; the development one DEVEL, such as
# 2.0.0-devel, built for fewer EL releases
if [ -f RELEASE ]; then
RELEASE=$(tr -d ' \t\r\n' < RELEASE)
echo "ELS=8 9 10" >> $GITHUB_ENV
else
RELEASE=$(tr -d ' \t\r\n' < DEVEL)
echo "ELS=9 10" >> $GITHUB_ENV
fi
echo "RELEASE=$RELEASE" >> $GITHUB_ENV
# rpm's Version, with a tilde for a hyphen (2.0.0~devel): the source
# archive and its directory are named after it
echo "RPMVERSION=$(sed -n 's/^Version:[[:space:]]*//p' scripts/rh/3proxy.spec)" >> $GITHUB_ENV
BUILDDATE=$(sed -n 's/^#define BUILDDATE "\(.*\)"$/\1/p' src/version.h) BUILDDATE=$(sed -n 's/^#define BUILDDATE "\(.*\)"$/\1/p' src/version.h)
[ -n "$BUILDDATE" ] || BUILDDATE=$(date -u +%y%m%d%H%M%S) [ -n "$BUILDDATE" ] || BUILDDATE=$(date -u +%y%m%d%H%M%S)
echo "VERSION=$BUILDDATE" >> $GITHUB_ENV echo "VERSION=$BUILDDATE" >> $GITHUB_ENV
@ -41,19 +53,19 @@ jobs:
run: | run: |
mkdir ~/debian mkdir ~/debian
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," . tar -czf ~/rpmbuild/SOURCES/3proxy-$RPMVERSION.tar.gz --transform "s,^,3proxy-$RPMVERSION/," .
ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz ln -s ~/rpmbuild/SOURCES/3proxy-$RPMVERSION.tar.gz ~/rpmbuild/SOURCES/$RPMVERSION.tar.gz
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RPMVERSION.spec
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz tar -czf ~/debian/3proxy_$RELEASE.orig.tar.gz --transform "s,^,3proxy-$RELEASE/," .
- name: rpmbuild - name: rpmbuild
run: | run: |
mkdir -p rpmout mkdir -p rpmout
for EL in 8 9 10; do for EL in $ELS; do
docker run --rm \ docker run --rm \
-v "$HOME/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz:/src.tar.gz:ro" \ -v "$HOME/rpmbuild/SOURCES/3proxy-$RPMVERSION.tar.gz:/src.tar.gz:ro" \
-v "$PWD/scripts/rh/3proxy.spec:/3proxy.spec:ro" \ -v "$PWD/scripts/rh/3proxy.spec:/3proxy.spec:ro" \
-v "$PWD/rpmout:/out" \ -v "$PWD/rpmout:/out" \
-e RELEASE="$RELEASE" -e HOSTUID="$(id -u)" -e HOSTGID="$(id -g)" \ -e RELEASE="$RPMVERSION" -e HOSTUID="$(id -u)" -e HOSTGID="$(id -g)" \
-e SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" \ -e SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" \
"almalinux:$EL" bash -c ' "almalinux:$EL" bash -c '
set -e set -e

View File

@ -9,7 +9,13 @@ permissions:
contents: read contents: read
jobs: jobs:
kind:
uses: ./.github/workflows/release-kind.yml
ci: ci:
# not for a release of the development branch
needs: kind
if: github.event_name != 'release' || needs.kind.outputs.devel != 'true'
permissions: permissions:
contents: write contents: write
id-token: write id-token: write

View File

@ -25,7 +25,19 @@ jobs:
- name: env - name: env
run: | run: |
pwd pwd
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV # a release branch has RELEASE; the development one DEVEL, such as
# 2.0.0-devel, built for fewer EL releases
if [ -f RELEASE ]; then
RELEASE=$(tr -d ' \t\r\n' < RELEASE)
echo "ELS=8 9 10" >> $GITHUB_ENV
else
RELEASE=$(tr -d ' \t\r\n' < DEVEL)
echo "ELS=9 10" >> $GITHUB_ENV
fi
echo "RELEASE=$RELEASE" >> $GITHUB_ENV
# rpm's Version, with a tilde for a hyphen (2.0.0~devel): the source
# archive and its directory are named after it
echo "RPMVERSION=$(sed -n 's/^Version:[[:space:]]*//p' scripts/rh/3proxy.spec)" >> $GITHUB_ENV
BUILDDATE=$(sed -n 's/^#define BUILDDATE "\(.*\)"$/\1/p' src/version.h) BUILDDATE=$(sed -n 's/^#define BUILDDATE "\(.*\)"$/\1/p' src/version.h)
[ -n "$BUILDDATE" ] || BUILDDATE=$(date -u +%y%m%d%H%M%S) [ -n "$BUILDDATE" ] || BUILDDATE=$(date -u +%y%m%d%H%M%S)
echo "VERSION=$BUILDDATE" >> $GITHUB_ENV echo "VERSION=$BUILDDATE" >> $GITHUB_ENV
@ -41,19 +53,19 @@ jobs:
run: | run: |
mkdir ~/debian mkdir ~/debian
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," . tar -czf ~/rpmbuild/SOURCES/3proxy-$RPMVERSION.tar.gz --transform "s,^,3proxy-$RPMVERSION/," .
ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz ln -s ~/rpmbuild/SOURCES/3proxy-$RPMVERSION.tar.gz ~/rpmbuild/SOURCES/$RPMVERSION.tar.gz
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RPMVERSION.spec
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz tar -czf ~/debian/3proxy_$RELEASE.orig.tar.gz --transform "s,^,3proxy-$RELEASE/," .
- name: rpmbuild - name: rpmbuild
run: | run: |
mkdir -p rpmout mkdir -p rpmout
for EL in 8 9 10; do for EL in $ELS; do
docker run --rm \ docker run --rm \
-v "$HOME/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz:/src.tar.gz:ro" \ -v "$HOME/rpmbuild/SOURCES/3proxy-$RPMVERSION.tar.gz:/src.tar.gz:ro" \
-v "$PWD/scripts/rh/3proxy.spec:/3proxy.spec:ro" \ -v "$PWD/scripts/rh/3proxy.spec:/3proxy.spec:ro" \
-v "$PWD/rpmout:/out" \ -v "$PWD/rpmout:/out" \
-e RELEASE="$RELEASE" -e HOSTUID="$(id -u)" -e HOSTGID="$(id -g)" \ -e RELEASE="$RPMVERSION" -e HOSTUID="$(id -u)" -e HOSTGID="$(id -g)" \
-e SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" \ -e SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" \
"almalinux:$EL" bash -c ' "almalinux:$EL" bash -c '
set -e set -e

View File

@ -9,7 +9,13 @@ permissions:
contents: read contents: read
jobs: jobs:
kind:
uses: ./.github/workflows/release-kind.yml
ci: ci:
# not for a release of the development branch
needs: kind
if: github.event_name != 'release' || needs.kind.outputs.devel != 'true'
permissions: permissions:
contents: write contents: write
id-token: write id-token: write

View File

@ -9,7 +9,13 @@ permissions:
contents: read contents: read
jobs: jobs:
kind:
uses: ./.github/workflows/release-kind.yml
ci: ci:
# not for a release of the development branch
needs: kind
if: github.event_name != 'release' || needs.kind.outputs.devel != 'true'
permissions: permissions:
contents: write contents: write
id-token: write id-token: write

View File

@ -27,7 +27,9 @@ jobs:
- name: set date - name: set date
run: | run: |
$NOW = Get-Date -Format "yyMMddHHmmss" $NOW = Get-Date -Format "yyMMddHHmmss"
$RELEASE = Get-Content -Path "RELEASE" -Raw # a release branch has RELEASE, the development one DEVEL
if (Test-Path "RELEASE") { $RELEASE = (Get-Content -Path "RELEASE" -Raw).Trim() }
else { $RELEASE = (Get-Content -Path "DEVEL" -Raw).Trim() }
echo "NOW=$NOW" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "NOW=$NOW" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

View File

@ -9,7 +9,13 @@ permissions:
contents: read contents: read
jobs: jobs:
kind:
uses: ./.github/workflows/release-kind.yml
ci: ci:
# not for a release of the development branch
needs: kind
if: github.event_name != 'release' || needs.kind.outputs.devel != 'true'
permissions: permissions:
contents: write contents: write
id-token: write id-token: write

View File

@ -13,7 +13,17 @@ env:
GHCR_IMAGE: ghcr.io/3proxy/3proxy GHCR_IMAGE: ghcr.io/3proxy/3proxy
jobs: jobs:
kind:
permissions:
contents: write
uses: ./.github/workflows/release-kind.yml
with:
mark-prerelease: true
build: build:
# not for a release of the development branch
needs: kind
if: github.event_name != 'release' || needs.kind.outputs.devel != 'true'
name: ${{ matrix.image }} ${{ matrix.platform }} name: ${{ matrix.image }} ${{ matrix.platform }}
permissions: permissions:
contents: read contents: read

46
.github/workflows/release-kind.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: Release kind
# Whether a release is one of the development branch: its tree has DEVEL
# and no RELEASE. Such a release gets the minimal set of packages (Windows
# x64, deb x86_64 and arm64, rpm for EL 9 and 10), no Docker images, and is
# made a prerelease: neither "Latest" nor taken into the package repository
# of 3proxy.github.io, which takes releases only.
on:
workflow_call:
inputs:
mark-prerelease:
description: "make a release of the development branch a prerelease"
type: boolean
default: false
outputs:
devel:
description: "true for a release of the development branch"
value: ${{ jobs.kind.outputs.devel }}
permissions:
contents: read
jobs:
kind:
runs-on: ubuntu-latest
outputs:
devel: ${{ steps.kind.outputs.devel }}
steps:
- uses: actions/checkout@v7
with:
sparse-checkout: |
RELEASE
DEVEL
sparse-checkout-cone-mode: false
- id: kind
run: |
if [ ! -f RELEASE ] && [ -f DEVEL ]; then devel=true; else devel=false; fi
echo "devel=$devel" >> "$GITHUB_OUTPUT"
echo "release of the development branch: $devel"
- name: Make it a prerelease
if: inputs.mark-prerelease && github.event_name == 'release' && steps.kind.outputs.devel == 'true' && !github.event.release.prerelease
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.event.release.tag_name }}
run: gh release edit "$TAG" -R "$GITHUB_REPOSITORY" --prerelease --latest=false

View File

@ -9,7 +9,13 @@ permissions:
contents: read contents: read
jobs: jobs:
kind:
uses: ./.github/workflows/release-kind.yml
tarball: tarball:
# not for a release of the development branch
needs: kind
if: github.event_name != 'release' || needs.kind.outputs.devel != 'true'
permissions: permissions:
contents: write contents: write
id-token: write id-token: write