Skip to content

Fill out-params in the compiler binary's knot_compile_impl #391

Fill out-params in the compiler binary's knot_compile_impl

Fill out-params in the compiler binary's knot_compile_impl #391

name: Release Binaries
on:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: write
jobs:
version:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.version.outputs.tag }}
steps:
- uses: actions/checkout@v4
- name: Compute version from commit date
id: version
run: |
read YEAR MONTH DAY HOUR MINUTE <<< \
"$(TZ=UTC git log -1 --format=%cd --date=format-local:'%Y %-m %-d %-H %-M')"
TIME=$((HOUR * 100 + MINUTE))
echo "tag=${YEAR}.${MONTH}.${DAY}.${TIME}" >> "$GITHUB_OUTPUT"
build:
needs: version
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
name: linux-x86_64
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
name: linux-aarch64
- os: macos-15
target: aarch64-apple-darwin
name: macos-aarch64
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Install Rust target
run: rustup target add ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Build knot, knot-lsp, and runtime
run: cargo build --release --target ${{ matrix.target }} -p knot-compiler -p knot-lsp -p knot-runtime
- name: Package knot
shell: bash
run: |
STAGE="knot-${{ needs.version.outputs.tag }}-${{ matrix.name }}"
mkdir -p "$STAGE"
cp "target/${{ matrix.target }}/release/knot" "$STAGE/"
cp "target/${{ matrix.target }}/release/libknot_runtime.a" "$STAGE/"
tar -czf "$STAGE.tar.gz" "$STAGE"
shasum -a 256 "$STAGE.tar.gz" > "$STAGE.tar.gz.sha256"
- name: Package knot-lsp
shell: bash
run: |
STAGE="knot-lsp-${{ needs.version.outputs.tag }}-${{ matrix.name }}"
mkdir -p "$STAGE"
cp "target/${{ matrix.target }}/release/knot-lsp" "$STAGE/"
tar -czf "$STAGE.tar.gz" "$STAGE"
shasum -a 256 "$STAGE.tar.gz" > "$STAGE.tar.gz.sha256"
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.version.outputs.tag }}
name: Knot ${{ needs.version.outputs.tag }}
files: |
knot-*.tar.gz
knot-*.tar.gz.sha256
make_latest: true