Skip to content

release

release #1

Workflow file for this run

name: release
# Cross-compiled static release binaries, one per architecture. The per-arch
# build matrix + steps live in the reusable _cross-build.yml (shared with
# build.yml's compile gate); this workflow resolves the toolchain version,
# builds + packages in release mode, and publishes the GitHub Release.
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
toolchain_version:
description: 'cross-tools/musl-cross release tag to use (blank = latest)'
required: false
default: ''
permissions:
contents: write
jobs:
# Resolve the toolchain release once so every arch builds against the same
# version. Defaults to the latest release; pin via the workflow_dispatch input
# to reproduce an older build.
resolve-toolchain:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.resolve.outputs.version }}
steps:
- name: Resolve cross-tools/musl-cross version
id: resolve
env:
GH_TOKEN: ${{ github.token }}
INPUT_VERSION: ${{ inputs.toolchain_version }}
run: |
set -euo pipefail
if [ -n "${INPUT_VERSION:-}" ]; then
VER="${INPUT_VERSION}"
else
VER=$(gh api repos/cross-tools/musl-cross/releases/latest --jq .tag_name)
fi
echo "Using cross-tools/musl-cross ${VER}"
echo "version=${VER}" >> "$GITHUB_OUTPUT"
# Build + package every arch (matrix + steps in _cross-build.yml).
build-release:
needs: resolve-toolchain
uses: ./.github/workflows/_cross-build.yml
with:
toolchain_version: ${{ needs.resolve-toolchain.outputs.version }}
package: true
create-release:
needs: build-release
# Only publish a release for tag pushes; workflow_dispatch runs build the
# artifacts (for testing) without creating one.
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v5
with:
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
kasld-*.tar.gz
kasld-*.tar.gz.sha256