blob: 21af121a346c38ce7cceab395754be8ac1977dad (
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
|
name: "MeshMC: Nix"
concurrency:
group: meshmc-nix-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- "master"
- "release-*"
tags:
- "*"
paths:
- "meshmc/**.cpp"
- "meshmc/**.h"
- "meshmc/**.java"
- "meshmc/**.ui"
- "meshmc/**.md"
- "meshmc/**.nix"
- "meshmc/nix/**"
- "meshmc/flake.lock"
- "meshmc/buildconfig/**"
- "meshmc/cmake/**"
- "meshmc/launcher/**"
- "meshmc/libraries/**"
- "meshmc/branding/**"
- "meshmc/tests/**"
- "meshmc/CMakeLists.txt"
- ".github/workflows/meshmc-nix.yml"
pull_request:
paths:
- "meshmc/**.cpp"
- "meshmc/**.h"
- "meshmc/**.java"
- "meshmc/**.ui"
- "meshmc/**.md"
- "meshmc/**.nix"
- "meshmc/nix/**"
- "meshmc/flake.lock"
- "meshmc/buildconfig/**"
- "meshmc/cmake/**"
- "meshmc/launcher/**"
- "meshmc/libraries/**"
- "meshmc/branding/**"
- "meshmc/tests/**"
- "meshmc/CMakeLists.txt"
- ".github/workflows/meshmc-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 }}
defaults:
run:
working-directory: meshmc
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v31
- name: Setup Nix Magic Cache
if: ${{ github.event_name == 'pull_request' }}
uses: DeterminateSystems/magic-nix-cache-action@v13
with:
diagnostic-endpoint: ""
use-flakehub: false
- 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"
|