mirror of
https://codeberg.org/icewind/logsmash.git
synced 2026-06-03 10:04:12 +02:00
flake reorg
This commit is contained in:
parent
9140759082
commit
2a34eee2f1
11 changed files with 179 additions and 285 deletions
68
.github/workflows/ci.yml
vendored
68
.github/workflows/ci.yml
vendored
|
|
@ -1,56 +1,44 @@
|
|||
on: [ push, pull_request ]
|
||||
on: [push, pull_request]
|
||||
|
||||
name: CI
|
||||
|
||||
jobs:
|
||||
check:
|
||||
matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
check-matrix: ${{ steps.set-matrix.outputs.check-matrix }}
|
||||
cross-matrix: ${{ steps.set-matrix.outputs.cross-matrix }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v27
|
||||
- id: set-matrix
|
||||
run: |
|
||||
echo "check-matrix={\"check\":$(nix eval --json '.#checks.x86_64-linux' --apply 'builtins.attrNames')}" | tee -a $GITHUB_OUTPUT
|
||||
echo "cross-matrix={\"include\":$(nix eval --json '.#lib.crossMatrix')}" | tee -a $GITHUB_OUTPUT
|
||||
|
||||
checks:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [matrix]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{fromJson(needs.matrix.outputs.check-matrix)}}
|
||||
name: ${{ matrix.check }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v26
|
||||
- uses: icewind1991/attic-action@v1
|
||||
with:
|
||||
name: ci
|
||||
instance: https://cache.icewind.me
|
||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||
- run: nix build .#check
|
||||
|
||||
|
||||
check-extractor:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v27
|
||||
- uses: icewind1991/attic-action@v1
|
||||
with:
|
||||
name: ci
|
||||
instance: https://cache.icewind.me
|
||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||
- run: nix build .#extractor
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: check
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v27
|
||||
- uses: icewind1991/attic-action@v1
|
||||
with:
|
||||
name: ci
|
||||
instance: https://cache.icewind.me
|
||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||
- run: nix build .#clippy
|
||||
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||
- run: nix build .#checks.x86_64-linux.${{ matrix.check }}
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: check
|
||||
needs: [matrix]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- x86_64-unknown-linux-musl
|
||||
- x86_64-pc-windows-gnu
|
||||
matrix: ${{fromJson(needs.matrix.outputs.cross-matrix)}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v27
|
||||
|
|
@ -58,16 +46,16 @@ jobs:
|
|||
with:
|
||||
name: ci
|
||||
instance: https://cache.icewind.me
|
||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||
- run: nix build .#${{ matrix.target }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: logsmash-${{ matrix.target }}
|
||||
path: result/bin/*
|
||||
path: result/bin/logsmash${{ matrix.binary-suffix }}
|
||||
|
||||
build-nixpkgs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: check
|
||||
needs: checks
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v27
|
||||
|
|
@ -75,5 +63,5 @@ jobs:
|
|||
with:
|
||||
name: ci
|
||||
instance: https://cache.icewind.me
|
||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||
- run: nix build .#logsmash
|
||||
|
|
|
|||
32
.github/workflows/release.yml
vendored
32
.github/workflows/release.yml
vendored
|
|
@ -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 }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue