-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 2.76 KB
/
build.yaml
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
name: Build cache
on:
push:
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@master
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: https://github.com/nix-community/nix-unstable-installer/releases/download/nix-2.14.0pre20230127_ccaadc9/install
extra_nix_config: |
experimental-features = nix-command flakes
substituters = https://staging.attic.rs/attic-ci https://attic.indexyz.me/indexyz https://indexyz.cachix.org https://cache.nixos.org/
trusted-public-keys = attic-ci:U5Sey4mUxwBXM3iFapmP0/ogODXywKLRNgRPQpEXxbo= indexyz:XxexOMK+bHXR2slT4A9wnJg00EZFXCUYqlUhlEEGQEc= indexyz.cachix.org-1:biBEnuZ4vTSsVMr8anZls+Lukq8w4zTHAK8/p+fdaJQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
- run: python .ci/build-matrix.py
id: set-matrix
build:
name: Build ${{ matrix.pacakges.name }}
runs-on: ubuntu-latest
if: needs.generate-matrix.outputs.matrix != ''
needs: [generate-matrix]
strategy:
fail-fast: false
max-parallel: 6
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@master
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: https://github.com/nix-community/nix-unstable-installer/releases/download/nix-2.14.0pre20230127_ccaadc9/install
extra_nix_config: |
experimental-features = nix-command flakes
substituters = https://staging.attic.rs/attic-ci https://attic.indexyz.me/indexyz https://indexyz.cachix.org https://cache.nixos.org/
trusted-public-keys = attic-ci:U5Sey4mUxwBXM3iFapmP0/ogODXywKLRNgRPQpEXxbo= indexyz:XxexOMK+bHXR2slT4A9wnJg00EZFXCUYqlUhlEEGQEc= indexyz.cachix.org-1:biBEnuZ4vTSsVMr8anZls+Lukq8w4zTHAK8/p+fdaJQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
- name: Build packages
run: |
set -ex
wget https://github.com/zhaofengli/attic/raw/main/.github/install-attic-ci.sh
chmod +x install-attic-ci.sh
./install-attic-ci.sh
attic login indexyz https://attic.indexyz.me "${{ secrets.ATTIC_TOKEN }}"
nix --version
PACKAGE="${{ matrix.pacakges.name }}"
nix build --no-link ".#"$PACKAGE
echo "Build Package Successfully"s
PACKAGE_LOCATION=$(nix eval --raw ".#"$PACKAGE)
echo "Package location: $PACKAGE_LOCATION"
attic push indexyz $PACKAGE_LOCATION
PACKAGE_DRV_LOCATION=$(nix eval --raw ".#"$PACKAGE".drvPath")
echo "Package drv location: $PACKAGE_DRV_LOCATION"
attic push indexyz $PACKAGE_DRV_LOCATION