This commit is contained in:
Robin Appelman 2024-08-10 13:23:57 +02:00
commit db2f6d81b5
4 changed files with 100 additions and 12 deletions

59
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,59 @@
on: [ push, pull_request ]
name: CI
jobs:
check:
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 .#check
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
build:
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 .#x86_64-unknown-linux-musl
- uses: actions/upload-artifact@v4
with:
name: evtype
path: result/bin/*
build-nixpkgs:
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 .#evtype

36
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,36 @@
name: Release
on:
release:
types: [ created ]
permissions:
contents: write
jobs:
release-binaries:
name: Build release binaries
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 .#x86_64-unknown-linux-musl
- name: Upload binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: result/bin/evtype
asset_name: evtype
tag: ${{ github.ref }}
- name: Upload Daemon binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: result/bin/evtype_daemon
asset_name: evtype_daemon
tag: ${{ github.ref }}

View file

@ -74,7 +74,7 @@
lib.attrsets.genAttrs targets (target:
(cross-naersk'.buildPackage target) nearskOpt)
// {
inherit (pkgs) logging-extractor extracted-logs extracted-logs-rust logsmash extracted-logs-rust-mod;
inherit (pkgs) evtype;
check = msrvNaersk.buildPackage (nearskOpt
// {
mode = "check";
@ -83,7 +83,7 @@
// {
mode = "clippy";
});
default = pkgs.logsmash;
default = pkgs.evtype;
};
apps.default = packages.default;

View file

@ -1,22 +1,15 @@
{
stdenv,
makeRustPlatform,
rust-bin,
rustPlatform,
lib,
extracted-logs-rust,
}: let
inherit (lib.sources) sourceByRegex;
src = sourceByRegex ../. ["Cargo.*" "(src)(/.*)?"];
rustPlatform = makeRustPlatform {
cargo = rust-bin.stable.latest.default;
rustc = rust-bin.stable.latest.default;
};
in
rustPlatform.buildRustPackage rec {
pname = "logsmash";
pname = "evtype";
version = "0.1.0";
inherit src;
src = sourceByRegex ../. ["Cargo.*" "(src)(/.*)?"];
cargoLock = {
lockFile = ../Cargo.lock;