mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-04 01:24:09 +02:00
nix ci
This commit is contained in:
parent
d4ac27389e
commit
2f4766ad8a
6 changed files with 231 additions and 117 deletions
51
.github/workflows/release.yaml
vendored
51
.github/workflows/release.yaml
vendored
|
|
@ -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 }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue