Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml → .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: 'publish'
name: 'publish alpha'
on:
release:
types: [created]
types: [prereleased]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3.3.0
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v16
- uses: cachix/install-nix-action@v18
with:
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v10
- uses: cachix/cachix-action@v12
with:
name: medable
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -f .
- env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: nix-shell --run "_npm_setup && lerna version && lerna publish from-package --dist-tag=@alpha --yes"
run: nix-shell --run "_npm_publish_alpha --yes"
23 changes: 23 additions & 0 deletions .github/workflows/latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'publish latest'
on:
release:
types: [released]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.3.0
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v18
with:
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v12
with:
name: medable
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -f .
- env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: nix-shell --run "_npm_publish_latest --yes"
72 changes: 36 additions & 36 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
with builtins;
{ pkgs ? import
(
fetchTarball {
name = "nixpkgs-unstable-2022-05-04";
url = "https://github.com/NixOS/nixpkgs/archive/ccb9c0e53779ec8995d22b26cbc792ad13f8d503.tar.gz";
sha256 = "08kplx00lkxg78zf8idfaw30mxrqc2a0f4da342f7hhf32xg41jk";
}
)
{
config = {
allowUnfree = true;
};
overlays = [ ];
}
{ medable ? import
(fetchTarball {
name = "medable-2023-03-10";
url = "https://github.com/Medable/nix/archive/59e6219a0dce236beffdde5b0a3d4ca25d9298e0.tar.gz";
sha256 = "0klf6vkg9bb6w2pp8rravqafgibn3lg3gs53g0771bv350d6fdv7";
})
{ }
, nixpkgs ? medable.jacobi
}:
let
inherit (pkgs.lib) flatten;
inherit (nixpkgs.lib) flatten;

node = pkgs.nodejs-14_x;
name = "mdctl";
node = nixpkgs.nodejs-16_x;

tools = with pkgs; {
tools = with nixpkgs; {
cli = [ ];
deps = [
gcc
glib
gnumake
libsecret
nodePackages.node-gyp
nodePackages.node-pre-gyp
pkg-config
sqlite
];
nix = [
nixpkgs-fmt
];
node = [
node
node.pkgs.lerna
npm = with node.pkgs; [
lerna
node-gyp
node-pre-gyp
];
osSpecific = with pkgs.darwin.apple_sdk.frameworks; if pkgs.stdenv.isDarwin then [
Security
AppKit
xcbuild
] else [ ];
scripts = [
(writeShellScriptBin "_npm_setup" ''
${node}/bin/npm install --ci
${node.pkgs.lerna}/bin/lerna bootstrap --hoist
'')
(writeShellScriptBin "_npm_publish" ''
${node.pkgs.lerna}/bin/lerna version
${node.pkgs.lerna}/bin/lerna publish from-package --dist-tag=@alpha
'')
];
scripts =
let
npm = "${node}/bin/npm";
lerna = "${node.pkgs.lerna}/bin/lerna";
in
[
(writeShellScriptBin "_npm_setup" ''
${npm} install --ci
'')
(writeShellScriptBin "_npm_publish_alpha" ''
${lerna} publish from-package --dist-tag=alpha "$@"
'')
(writeShellScriptBin "_npm_publish_latest" ''
${lerna} publish from-package --dist-tag=latest "$@"
'')
];
};

shell = pkgs.mkShell {
name = "mdctl";
packages = flatten [ (flatten (attrValues tools)) ];
paths = flatten [ (flatten (builtins.attrValues tools)) ];
shell = nixpkgs.mkShell {
inherit name;
packages = paths;
};
in
shell