@@ -5,9 +5,6 @@ on:
55 branches: [master]
66 pull_request:
77
8−env:
9− CARGO_TERM_COLOR: always
10−
118jobs:
129 build:
1310 strategy:
@@ -16,48 +13,29 @@ jobs:
1613 include:
1714 - runner: ubuntu-latest
1815 name: linux-x86_64
19− musl-target: x86_64-unknown-linux-musl
16+ knot-platform: linux-x86_64
2017 - runner: ubuntu-24.04-arm
2118 name: linux-arm64
22− musl-target: aarch64-unknown-linux-musl
19+ knot-platform: linux-aarch64
2320 - runner: macos-26
2421 name: macos-arm64
25− - runner: macos-26-intel
26− name: macos-x86_64
22+ knot-platform: macos-aarch64
2723 runs-on: ${{ matrix.runner }}
2824 steps:
2925 - uses: actions/checkout@v4
3026
31− - uses: actions/checkout@v4
32− with:
33− repository: ilyakooo0/knot
34− path: knot
35−
36− - uses: dtolnay/rust-toolchain@stable
37−
38− - name: Install musl toolchain
39− if: runner.os == 'Linux'
27+ - name: Download knot compiler
4028 run: |
41− sudo apt-get update
42− sudo apt-get install -y musl-tools
43− rustup target add ${{ matrix.musl-target }}
44−
45− - uses: actions/cache@v4
46− with:
47− path: |
48− ~/.cargo/registry
49− ~/.cargo/git
50− knot/target
51− key: ${{ matrix.name }}-cargo-${{ hashFiles('knot/Cargo.lock') }}
29+ version=$(basename "$(curl -sI -o /dev/null -w '%{redirect_url}' \
30+ https://github.com/ilyakooo0/knot/releases/latest)")
31+ tarball="knot-${version}-${{ matrix.knot-platform }}.tar.gz"
32+ curl -fsSL "https://github.com/ilyakooo0/knot/releases/download/${version}/${tarball}" \
33+ | tar xz
34+ mv "knot-${version}-${{ matrix.knot-platform }}" knot-dist
5235
53− - name: Build knotc
54− working-directory: knot
55− run: cargo build --release -p knot-compiler
56−
57− - name: Build musl runtime
36+ - name: Install musl toolchain
5837 if: runner.os == 'Linux'
59− working-directory: knot
60− run: cargo build --release -p knot-runtime --target ${{ matrix.musl-target }}
38+ run: sudo apt-get update && sudo apt-get install -y musl-tools
6139
6240 - name: Compile server (Linux static)
6341 if: runner.os == 'Linux'
@@ -65,12 +43,12 @@ jobs:
6543 printf '#!/bin/sh\nexec musl-gcc -static "$@"\n' > /tmp/static-cc
6644 chmod +x /tmp/static-cc
6745 CC=/tmp/static-cc \
68− KNOT_RUNTIME_LIB=${{ github.workspace }}/knot/target/${{ matrix.musl-target }}/release/libknot_runtime.a \
69− ./knot/target/release/knotc build server.knot
46+ KNOT_RUNTIME_LIB=${{ github.workspace }}/knot-dist/libknot_runtime.a \
47+ ./knot-dist/knot build server.knot
7048
7149 - name: Compile server (macOS)
7250 if: runner.os == 'macOS'
73− run: ./knot/target/release/knotc build server.knot
51+ run: ./knot-dist/knot build server.knot
7452
7553 - name: Verify binary
7654 run: file server