Push builds to cachix

This commit is contained in:
Natsu Kagami 2023-06-03 13:32:26 +02:00
parent e73247e7d4
commit 500eadeed0
Signed by: nki
GPG key ID: 55A032EB38B49ADB
2 changed files with 26 additions and 0 deletions

View file

@ -67,3 +67,23 @@ jobs:
run: cargo test
env:
SQLX_OFFLINE: "true"
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v20
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/toolchain@v1
id: cargo
with:
toolchain: stable
components: clippy
- uses: cachix/cachix-action@v12
with:
name: natsukagami
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Run nix build
run: nix build

View file

@ -6,6 +6,10 @@
naersk.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
nixConfig = {
extra-substituters = [ "https://natsukagami.cachix.org" ];
trusted-public-keys = [ "natsukagami.cachix.org-1:3U6GV8i8gWEaXRUuXd2S4ASfYgdl2QFPWg4BKPbmYiQ=" ];
};
outputs = { self, nixpkgs, naersk, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
@ -27,6 +31,8 @@
nativeBuildInputs = nixpkgs.lib.optionals pkgs.stdenv.isLinux (with pkgs; [
pkg-config
]);
SQLX_OFFLINE = "true";
};
defaultPackage = packages.youmubot;