forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (84 loc) · 2.97 KB
/
guix-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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Guix Build
permissions:
packages: write
id-token: write
attestations: write
on:
pull_request_target:
push:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
build_target: [x86_64-linux-gnu, arm-linux-gnueabihf, aarch64-linux-gnu, riscv64-linux-gnu, x86_64-w64-mingw32, x86_64-apple-darwin, arm64-apple-darwin]
timeout-minutes: 480
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: dash
fetch-depth: 0
- name: Install Guix
# uses: PastaPastaPasta/guix-install-action@v1
run: |
sudo apt-get install -y guix
- name: Cache Guix and depends
id: guix-cache-restore
uses: actions/cache@v3
with:
path: |
/gnu/store
/var/guix
~/.cache/guix
${{ github.workspace }}/dash/depends/built
${{ github.workspace }}/dash/depends/sources
${{ github.workspace }}/dash/depends/work
key: ${{ runner.os }}-guix-${{ matrix.build_target }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-guix-${{ matrix.build_target }}
${{ runner.os }}-guix-
- name: Guix Pull
# uses: PastaPastaPasta/guix-install-action@v1
run: |
guix pull
- name: Set up macOS SDK
if: contains(matrix.build_target, 'apple-darwin')
run: |
set -eo pipefail
WORKSPACE_PATH="${{ github.workspace }}/dash"
XCODE_VERSION="12.2"
XCODE_RELEASE="12B45b"
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
if [ ! -d "${WORKSPACE_PATH}/depends/SDKs/${XCODE_ARCHIVE}" ]; then
mkdir -p "${WORKSPACE_PATH}/depends/SDKs"
curl -L https://bitcoincore.org/depends-sources/sdks/${XCODE_ARCHIVE}.tar.gz | tar -xz -C "${WORKSPACE_PATH}/depends/SDKs"
fi
shell: bash
- name: Run Guix build
timeout-minutes: 480
working-directory: ./dash
run: |
HOSTS=${{ matrix.build_target }} ./contrib/guix/guix-build
- name: Ensure build passes
run: |
if [[ $? != 0 ]]; then
echo "Guix build failed!"
exit 1
fi
- name: Compute SHA256 checksums
continue-on-error: true
working-directory: ./dash
run: |
HOSTS=${{ matrix.build_target }} ./contrib/guix/guix-verify
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: guix-artifacts-${{ matrix.build_target }}
path: |
${{ github.workspace }}/dash/guix-build*/output/${{ matrix.build_target }}/
- name: Attest build provenance
uses: actions/attest-build-provenance@v1
with:
subject-path: ${{ github.workspace }}/dash/guix-build*/output/${{ matrix.build_target }}/*