Skip to content

Commit 8a72377

Browse files
Merge pull request #2 from sarcasticadmin/rh/1672626335
[READY] - Release process with pdfs
2 parents a5bd9fc + f27b502 commit 8a72377

4 files changed

Lines changed: 42 additions & 4 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: release
3+
4+
on:
5+
push:
6+
tags:
7+
- '*'
8+
workflow_dispatch:
9+
10+
jobs:
11+
releaser:
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: install-nix
16+
uses: cachix/install-nix-action@v18
17+
- name: create-release-with-artifacts
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
20+
RELEASE_TAG: ${{github.ref_name}}
21+
run:
22+
nix develop .#release --command ci-release

‎flake.nix‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@
3131
};
3232
simple-slides = final.callPackage ./simple/default.nix { };
3333
openwrt-at-scale = final.callPackage ./openwrt-at-scale/default.nix { };
34+
all-slides = final.linkFarmFromDrvs "all-slides" [ simple-slides openwrt-at-scale ];
35+
3436
};
3537

3638
packages = forAllSystems (system: {
37-
inherit (nixpkgsFor.${system}) simple-slides openwrt-at-scale;
39+
inherit (nixpkgsFor.${system}) simple-slides openwrt-at-scale all-slides;
3840
});
3941

4042
devShells = forAllSystems (system:
@@ -48,6 +50,20 @@
4850
rubber
4951
];
5052
};
53+
release =
54+
let
55+
ciRelease = pkgs.writeScriptBin "ci-release" ''
56+
test ! -z $RELEASE_TAG || { echo "Please set RELEASE_TAG variable"; exit 1; }
57+
nix build '.#all-slides'
58+
gh release create $RELEASE_TAG result/**/*.pdf -t "$RELEASE_TAG" --notes ""
59+
'';
60+
in
61+
pkgs.mkShell {
62+
buildInputs = with pkgs;[
63+
gh
64+
] ++ [ ciRelease ];
65+
};
66+
5167
});
5268
};
5369
# Bold green prompt for `nix develop`

‎openwrt-at-scale/default.nix‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ stdenv.mkDerivation {
1313

1414
installPhase = ''
1515
mkdir -p $out
16-
cp slides.pdf $out/
16+
cp slides.pdf $out/$pname-slides.pdf
1717
'';
1818
}

‎simple/default.nix‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ texLive, rubber, stdenv, lib }:
22

33
stdenv.mkDerivation {
4-
pname = "simple-slides";
4+
pname = "simple";
55
version = "1970-01-01";
66

77
src = ./.;
@@ -13,6 +13,6 @@ stdenv.mkDerivation {
1313

1414
installPhase = ''
1515
mkdir -p $out
16-
cp slides.pdf $out/
16+
cp slides.pdf $out/$pname-slides.pdf
1717
'';
1818
}

0 commit comments

Comments
 (0)