Skip to content

Commit ffbb237

Browse files
authored
Merge pull request #1 from holochain/bundle
Add bundles
2 parents 3505a15 + f1fe26f commit ffbb237

File tree

3 files changed

+166
-2
lines changed

3 files changed

+166
-2
lines changed

.github/workflows/build.yaml

+39-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- main
7+
pull_request:
8+
branches:
9+
- main
710

811
jobs:
912
build-holochain:
@@ -82,4 +85,39 @@ jobs:
8285
install_url: https://releases.nixos.org/nix/nix-2.20.4/install
8386

8487
- name: Build for x86_64-apple-darwin
85-
run: nix build .#lair_keystore_aarch64-apple
88+
run: nix build .#lair_keystore_aarch64-apple
89+
90+
bundle-x86-64-linux:
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@v4
94+
95+
- name: Install nix
96+
uses: cachix/install-nix-action@v26
97+
with:
98+
install_url: https://releases.nixos.org/nix/nix-2.20.4/install
99+
100+
- name: Build Lair Keystore
101+
run: |
102+
nix bundle .#holonix_lair_keystore
103+
./lair-keystore --version
104+
105+
- name: Build Holochain
106+
run: |
107+
nix bundle .#holonix_holochain
108+
./holochain --version
109+
110+
- name: Build hc CLI
111+
run: |
112+
nix bundle .#holonix_hc
113+
./hc --version
114+
115+
- name: Build hc-run-local-services CLI
116+
run: |
117+
nix bundle .#holonix_hc_run_local_services
118+
./hc-run-local-services --version
119+
120+
- name: Build hcterm CLI
121+
run: |
122+
nix bundle .#holonix_hcterm
123+
./hcterm --version

flake.lock

+100
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+27-1
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,24 @@
3333
url = "github:holochain/lair";
3434
flake = false;
3535
};
36+
37+
holonix = {
38+
url = "github:holochain/holonix";
39+
inputs.nixpkgs.follows = "nixpkgs";
40+
inputs.crane.follows = "crane";
41+
inputs.rust-overlay.follows = "rust-overlay";
42+
inputs.holochain.follows = "holochain";
43+
inputs.lair-keystore.follows = "lair-keystore";
44+
};
3645
};
3746

3847
outputs = inputs @ { nixpkgs, crane, flake-utils, rust-overlay, ... }:
3948
flake-utils.lib.eachDefaultSystem
4049
(localSystem: {
4150
packages =
4251
let
52+
pkgs = nixpkgs.legacyPackages.${localSystem};
53+
4354
defineHolochainPackages = { crate, package }: {
4455
"${package}_aarch64-linux" = import ./modules/holochain-cross.nix {
4556
inherit localSystem inputs crate package;
@@ -87,12 +98,27 @@
8798
rustTargetTriple = "aarch64-apple-darwin";
8899
};
89100
} else { });
101+
102+
extractHolochainBin = bin: pkgs.stdenv.mkDerivation {
103+
name = bin;
104+
unpackPhase = "true";
105+
installPhase = ''
106+
mkdir -p $out/bin
107+
cp ${inputs.holonix.packages.${localSystem}.holochain}/bin/${bin} $out/bin
108+
'';
109+
};
90110
in
91111
(defineHolochainPackages { crate = "holochain"; package = "holochain"; }) //
92112
(defineHolochainPackages { crate = "hc"; package = "holochain_cli"; }) //
93113
(defineHolochainPackages { crate = "hc_run_local_services"; package = "holochain_cli_run_local_services"; }) //
94114
(defineHolochainPackages { crate = "holochain_terminal"; package = "hcterm"; }) //
95-
(defineLairKeystorePackages { })
115+
(defineLairKeystorePackages { }) // (if localSystem != "aarch64-linux" then {
116+
holonix_holochain = extractHolochainBin "holochain";
117+
holonix_hc = extractHolochainBin "hc";
118+
holonix_hc_run_local_services = extractHolochainBin "hc-run-local-services";
119+
holonix_hcterm = extractHolochainBin "hcterm";
120+
holonix_lair_keystore = inputs.holonix.packages.${localSystem}.lair-keystore;
121+
} else { })
96122
;
97123
}) // {
98124
# Add dev helpers that are not required to be platform agnostic

0 commit comments

Comments
 (0)