Files
VoidTeamspeak/.gitea/workflows/release.yml
T
faumaray df72a5f885
Release / release (push) Failing after 3m37s
Release: export token for publisher
2026-07-30 03:34:04 +03:00

101 lines
3.4 KiB
YAML

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
release:
runs-on: echoion-release-serial
permissions:
contents: write
steps:
- name: Check out VoidTeamspeak
uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
fetch-depth: 0
persist-credentials: false
- name: Check out pinned VoidLibrary dependency
uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: Void/VoidLibrary
ref: ${{ vars.VOID_LIBRARY_RELEASE_REF }}
path: .deps/VoidLibrary
persist-credentials: false
- name: Check out pinned public release tooling
uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: Void/Echoion
ref: ${{ vars.ECHOION_RELEASE_TOOLS_REF }}
path: .release-tools
persist-credentials: false
- name: Verify immutable release inputs
shell: bash
run: |
set -euo pipefail
[[ "${{ vars.VOID_LIBRARY_RELEASE_REF }}" =~ ^[0-9a-f]{40}$ ]]
[[ "${{ vars.ECHOION_RELEASE_TOOLS_REF }}" =~ ^[0-9a-f]{40}$ ]]
test "$(git -C .deps/VoidLibrary rev-parse HEAD)" = \
"${{ vars.VOID_LIBRARY_RELEASE_REF }}"
test "$(git -C .release-tools rev-parse HEAD)" = \
"${{ vars.ECHOION_RELEASE_TOOLS_REF }}"
[[ "$GITHUB_REF_TYPE" == "tag" ]]
[[ "$GITHUB_REF_NAME" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]
version="${BASH_REMATCH[1]}"
project_version="$(
sed -nE \
's/^project\(VoidTeamspeak VERSION ([0-9]+\.[0-9]+\.[0-9]+).*$/\1/p' \
CMakeLists.txt
)"
test "$version" = "$project_version"
- name: Configure
run: |
cmake -S . -B build-release -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DVOID_TEAMSPEAK_BUILD_TESTS=ON \
-DCPM_Void_SOURCE="$PWD/.deps/VoidLibrary"
- name: Build and test
run: |
cmake --build build-release --parallel
ctest --test-dir build-release --output-on-failure
- name: Install and package
shell: bash
run: |
set -euo pipefail
version="${GITHUB_REF_NAME#v}"
package="voidteamspeak-${version}-linux-x86_64"
epoch="$(git show -s --format=%ct HEAD)"
cmake --install build-release \
--prefix "$PWD/stage/$package"
mkdir -p dist
SOURCE_DATE_EPOCH="$epoch" \
tar --sort=name --mtime="@$epoch" \
--owner=0 --group=0 --numeric-owner \
--zstd -cf "dist/$package.tar.zst" \
-C stage "$package"
sha256sum "dist/$package.tar.zst" > dist/SHA256SUMS
- name: Publish native Gitea release
env:
GITEA_RELEASE_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
python3 .release-tools/scripts/gitea_release.py \
--api-url "${{ gitea.api_url }}" \
publish \
--owner Void \
--repo VoidTeamspeak \
--tag "$GITHUB_REF_NAME" \
--target "$GITHUB_SHA" \
--name "VoidTeamspeak ${GITHUB_REF_NAME#v}" \
--body "Reproducible VoidTeamspeak SDK and shared-library package." \
--artifacts dist