blob: a62d9c0aff1312f7d1607d48d99609f3fb5680f9 (
plain)
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
name: Nix
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- "master"
- "release-*"
tags:
- "*"
paths:
# File types
- "**.cpp"
- "**.h"
- "**.java"
- "**.ui"
- "**.md"
# Build files
- "**.nix"
- "nix/**"
- "flake.lock"
# Directories
- "buildconfig/**"
- "cmake/**"
- "launcher/**"
- "libraries/**"
- "branding/**"
- "tests/**"
# Files
- "CMakeLists.txt"
# Workflows
- ".github/workflows/nix.yml"
pull_request:
paths:
# File types
- "**.cpp"
- "**.h"
- "**.java"
- "**.ui"
- "**.md"
# Build files
- "**.nix"
- "nix/**"
- "flake.lock"
# Directories
- "buildconfig/**"
- "cmake/**"
- "launcher/**"
- "libraries/**"
- "branding/**"
- "tests/**"
# Files
- "CMakeLists.txt"
# Workflows
- ".github/workflows/nix.yml"
workflow_dispatch:
permissions: {}
env:
DEBUG: ${{ github.ref_type != 'tag' }}
jobs:
build:
name: Build (${{ matrix.system }})
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
system: x86_64-linux
- os: ubuntu-22.04-arm
system: aarch64-linux
- os: macos-14
system: aarch64-darwin
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v31
# For PRs
- name: Setup Nix Magic Cache
if: ${{ github.event_name == 'pull_request' }}
uses: DeterminateSystems/magic-nix-cache-action@v13
with:
diagnostic-endpoint: ""
use-flakehub: false
# For in-tree builds
- name: Setup Cachix
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
uses: cachix/cachix-action@v17
with:
name: meshmc
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Run Flake checks
run: |
nix flake check --print-build-logs --show-trace
- name: Build debug package
if: ${{ env.DEBUG == 'true' }}
run: |
nix build \
--no-link --print-build-logs --print-out-paths \
.#meshmc-debug >> "$GITHUB_STEP_SUMMARY"
- name: Build release package
if: ${{ env.DEBUG == 'false' }}
env:
TAG: ${{ github.ref_name }}
SYSTEM: ${{ matrix.system }}
run: |
nix build --no-link --print-out-paths .#meshmc \
| tee -a "$GITHUB_STEP_SUMMARY" \
| xargs cachix pin meshmc "$TAG"-"$SYSTEM"
|