-
Notifications
You must be signed in to change notification settings - Fork 196
61 lines (61 loc) · 2.41 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Binary Build
on:
push:
branches:
- master
- 'v.+'
tags: ['**']
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, ARM64]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/d899609c2a22bbd345d2ed200c6ebc08a772ccc9.tar.gz
if: matrix.os != 'ARM64'
- uses: cachix/cachix-action@v14
with:
name: digitallyinduced
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
if: matrix.os != 'ARM64'
- run: git clone https://github.com/digitallyinduced/ihp-boilerplate.git
- name: Cache build directory
uses: actions/cache@v4
with:
path: |
ihp-boilerplate/build
key: ${{ runner.os }}-ghc
if: matrix.os != 'ARM64'
- run: |
cd ihp-boilerplate
nix-shell -p php --run "php ../.github/patch-flakes.php ${{ github.ref }} ${{ github.event.repository.full_name }} ${{ github.sha }}"
cat flake.nix
mv Makefile Makefile.old
echo 'GHC_OPTIONS+= -rtsopts=all\n.SHELLFLAGS := -eu -o pipefail -c\n\n'|cat - Makefile.old > Makefile
nix develop --impure --command bash -c "new-application Web && make build/bin/RunUnoptimizedProdServer"
- name: Build IHP app
run: |
cd ihp-boilerplate && nix develop --impure --profile ihp-boilerplate-profile --command "true"
- name: Install jq
run: nix profile install nixpkgs#jq
if: matrix.os != 'ARM64'
- name: Push IHP app to cachix
run: |
cd ihp-boilerplate
# Cachix doesn't natively support nix flakes in it's cachix-action
# See https://github.com/cachix/cachix-action/issues/47
cachix push digitallyinduced ihp-boilerplate-profile
# Pushing runtime closure
nix develop --impure --command bash -c 'make -s all; new-application Web'
git add . # So the generated files are available to nix flakes
nix build --json --impure | jq -r '.[].outputs | to_entries[].value' | cachix push digitallyinduced
# Also build the framework's dev env
- name: Build framework devShell
run: nix develop --impure --profile ihp-profile --command "true"
- name: Push framework devShell to cachix
run: cachix push digitallyinduced ihp-profile