flake reorg

This commit is contained in:
Robin Appelman 2024-09-27 17:40:09 +02:00
commit 2a34eee2f1
11 changed files with 179 additions and 285 deletions

View file

@ -2,23 +2,29 @@ name: Release
on:
release:
types: [ created ]
types: [created]
permissions:
contents: write
jobs:
release-binaries:
name: Build release binaries
matrix:
runs-on: ubuntu-latest
outputs:
cross-matrix: ${{ steps.set-matrix.outputs.cross-matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- id: set-matrix
run: |
echo "cross-matrix={\"include\":$(nix eval --json '.#lib.crossMatrix')}" | tee -a $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: [matrix]
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
ext: ""
- target: x86_64-pc-windows-gnu
ext: ".exe"
matrix: ${{fromJson(needs.matrix.outputs.cross-matrix)}}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
@ -26,12 +32,12 @@ jobs:
with:
name: ci
instance: https://cache.icewind.me
authToken: '${{ secrets.ATTIC_TOKEN }}'
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: result/bin/logsmash${{ matrix.ext }}
asset_name: logsmash-${{ matrix.target }}${{ matrix.ext }}
tag: ${{ github.ref }}
file: result/bin/logsmash${{ matrix.binary-suffix }}
asset_name: logsmash-${{ matrix.target }}${{ matrix.binary-suffix }}
tag: ${{ github.ref }}