-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (71 loc) · 2.64 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# SPDX-FileCopyrightText: 2023-2024 TII (SSRC) and the Ghaf contributors
#
# SPDX-License-Identifier: Apache-2.0
name: build
on:
push:
branches:
- "gh_actions_updates"
permissions:
contents: read
jobs:
build_target:
runs-on: ubuntu-latest
timeout-minutes: 360
name: Build FMO-OS
steps:
# To use this repository's private action,
# you must check out the repository
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Get nixpkgs revision
id: nixpkgs_rev
run: |
echo "NIXPKGS=github:NixOS/nixpkgs/$(jq -r '.nodes.nixpkgs.locked.rev' flake.lock)" >> $GITHUB_OUTPUT
- name: Install nix
id: nix_install
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=${{ steps.nixpkgs_rev.outputs.NIXPKGS }}
extra_nix_config: |
accept-flake-config = true
trusted-public-keys = prod-cache.vedenemo.dev~1:JcytRNMJJdYJVQCYwLNsrfVhct5dhCK2D3fa6O1WHOI= cache.ssrcdevops.tii.ae:oOrzj9iCppf+me5/3sN/BxEkp5SaFkHfKTPPZ97xXQk=
trusted-substituters = https://prod-cache.vedenemo.dev https://cache.ssrcdevops.tii.ae
substituters = https://prod-cache.vedenemo.dev https://cache.ssrcdevops.tii.ae
run: |
echo "Nix info"
nix-shell -p nix-info --run "nix-info -m"
echo "Check nixpkgs version"
nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- name: Prepare build
uses: cachix/cachix-action@v15
with:
name: fmo-os
authToken: "${{ secrets.CACHIX_TOKEN }}"
- name: Build
run: |
SSH_DIR=$HOME/.ssh
mkdir -p $SSH_DIR
echo '${{ secrets.RA_TOKEN }}' > $SSH_DIR/id_rsa
chmod 0600 $SSH_DIR/id_rsa
ssh-keyscan -t ed25519 -H github.com > $SSH_DIR/known_hosts
chmod 600 $SSH_DIR/known_hosts
nix flake show
cachix watch-exec fmo-os -- nix build --print-build-logs .#packages.x86_64-linux.fmo-os-installer-debug
nix-collect-garbage