Skip to content

Commit

Permalink
feat(ci): Build static binaries and upload as artifacts.
Browse files Browse the repository at this point in the history
  • Loading branch information
vifino committed Jan 31, 2024
1 parent 5a22f87 commit b53b410
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Static

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
integration:
runs-on: ubuntu-latest
strategy:
matrix:
system: [x86_64-linux, i686-linux, aarch64-linux]
name: ${{ matrix.system }}
steps:
- uses: actions/checkout@v3
- name: Setup QEMU User and binfmt
uses: docker/setup-qemu-action@v3
if: ${{ matrix.system != 'x86_64-linux' && matrix.system != 'i686-linux' }}
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: "extra-platforms = ${{ matrix.system }}"
- name: Setup Magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build static binary
run: |
nix build -L .#packages.${{ matrix.system }}.nvmetcfg-static
echo "nvmetBinary=$(nix eval --raw .#packages.${{ matrix.system }}.nvmetcfg-static)/bin/nvmet" >> $GITHUB_ENV
- name: Upload workflow artifacts
uses: actions/upload-artifact@v4
with:
name: nvmet-${{ matrix.system }}
path: ${{ env.nvmetBinary }}
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
lib,
pkgs,
rustPlatform,
...
}:
pkgs.rustPlatform.buildRustPackage {
rustPlatform.buildRustPackage {
pname = "nvmetcfg";
version = "0.1.0";
src = ./.;
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
in {
packages = rec {
nvmetcfg = pkgs.callPackage ./. {};
nvmetcfg-static = pkgs.pkgsStatic.callPackage ./. {};
default = nvmetcfg;
};
devShells.default = pkgs.mkShell {
Expand Down

0 comments on commit b53b410

Please sign in to comment.