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-relwithdebinfo -G Ninja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DBUILD_SHARED_LIBS=ON \ -DVOID_ENABLE_TESTING=ON \ -DVOID_WARNINGS_AS_ERRORS=ON - name: Build and test run: | cmake --build build-relwithdebinfo --config RelWithDebInfo --parallel ctest --test-dir build-relwithdebinfo \ --build-config RelWithDebInfo --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-relwithdebinfo \ --config RelWithDebInfo \ --prefix "$PWD/stage/$package" python3 .release-tools/scripts/verify-relwithdebinfo.py \ --root "$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" ( cd dist sha256sum "$package.tar.zst" > SHA256SUMS ) - name: Publish native Gitea release env: GITEA_RELEASE_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