Files
Library/.gitea/workflows/release.yml
T
faumaray f528ef644c
Release / release (push) Failing after 20m42s
Align release workflow with Gitea Actions
2026-07-29 23:11:54 +03:00

90 lines
2.9 KiB
YAML

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
release:
runs-on: echoion-release-serial
permissions:
contents: write
steps:
- name: Check out VoidLibrary
uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
fetch-depth: 0
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.ECHOION_RELEASE_TOOLS_REF }}" =~ ^[0-9a-f]{40}$ ]]
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\(Void 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_ENABLE_TESTING=ON \
-DVOID_WARNINGS_AS_ERRORS=ON
- 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="voidlibrary-${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_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN }}
run: |
python3 .release-tools/scripts/gitea_release.py \
--api-url "${{ gitea.api_url }}" \
publish \
--owner Void \
--repo VoidLibrary \
--tag "$GITHUB_REF_NAME" \
--target "$GITHUB_SHA" \
--name "VoidLibrary ${GITHUB_REF_NAME#v}" \
--body "Reproducible VoidLibrary SDK and shared-library package." \
--artifacts dist