1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-04 01:24:09 +02:00
This commit is contained in:
Robin Appelman 2023-06-15 18:18:35 +02:00
commit 2f4766ad8a
6 changed files with 231 additions and 117 deletions

View file

@ -5,37 +5,34 @@ on:
types: [created]
jobs:
build:
name: Build Static Linux Binaries
matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: musl-tools
run: |
sudo apt-get install musl-tools
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: cachix/install-nix-action@v20
- id: set-matrix
run: echo "matrix=$(nix eval --json ".#releaseMatrix.x86_64-linux")" | tee $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: matrix
strategy:
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- uses: icewind1991/attic-action@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all --target x86_64-unknown-linux-musl
- name: Upload binary
name: ci
instance: https://cache.icewind.me
authToken: '${{ secrets.ATTIC_TOKEN }}'
- run: nix build .#${{ matrix.target }}
- name: Upload binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/x86_64-unknown-linux-musl/release/haze
asset_name: haze
tag: ${{ github.ref }}
- name: Create archive
run: tar -czvf haze.tgz -C target/x86_64-unknown-linux-musl/release haze
- name: Upload archive
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: haze.tgz
asset_name: haze.tgz
tag: ${{ github.ref }}
file: result/bin/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}