-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (61 loc) · 1.83 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
name: Build Wittano nix repository
run-name: Build Wittano nix repository
on:
repository_dispatch:
types: [create-pull-request]
push:
branches:
- 'main'
pull_request:
types: [opened, edited, reopened, synchronize]
permissions:
contents: read
jobs:
check-flake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v11
- uses: DeterminateSystems/magic-nix-cache-action@v6
- uses: DeterminateSystems/flake-checker-action@v7
- name: Check nix repository
run: nix flake check
build:
needs:
- check-flake
strategy:
matrix:
packages: [
nixos-blur-playmouth,
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 10
- uses: DeterminateSystems/nix-installer-action@v11
- uses: DeterminateSystems/magic-nix-cache-action@v6
- name: Check flake lock diff
id: flake-diff
env:
pkgName: ${{ matrix.packages }}
run: |
PKG_DIR=$(find ./pkgs -type d -iname $pkgName)
if [ -n "$PKG_DIR" ]; then
FILE_DIFF=$(git diff HEAD~1 -- $PKG_DIR)
else
FILE_DIFF=""
fi
DIFF=$(git diff HEAD~1 -- flake.lock)
if [ -n "$DIFF" ] || [ -n "$FILE_DIFF" ]; then
echo "raw-diff=1" >> $GITHUB_OUTPUT
fi
- name: "Install Cachix"
uses: cachix/cachix-action@v14
if: ${{ github.ref == 'refs/heads/main' && steps.flake-diff.outputs.raw-diff }}
with:
name: wittano-nix-repo
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: "Build packages"
if: ${{ steps.flake-diff.outputs.raw-diff }}
run: "nix build .#packages.x86_64-linux.${{ matrix.packages }}"