summaryrefslogtreecommitdiff
path: root/meshmc/.github/workflows/nix.yml
diff options
context:
space:
mode:
authorMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:45:07 +0300
committerMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:45:07 +0300
commit31b9a8949ed0a288143e23bf739f2eb64fdc63be (patch)
tree8a984fa143c38fccad461a77792d6864f3e82cd3 /meshmc/.github/workflows/nix.yml
parent934382c8a1ce738589dee9ee0f14e1cec812770e (diff)
parentfad6a1066616b69d7f5fef01178efdf014c59537 (diff)
downloadProject-Tick-31b9a8949ed0a288143e23bf739f2eb64fdc63be.tar.gz
Project-Tick-31b9a8949ed0a288143e23bf739f2eb64fdc63be.zip
Add 'meshmc/' from commit 'fad6a1066616b69d7f5fef01178efdf014c59537'
git-subtree-dir: meshmc git-subtree-mainline: 934382c8a1ce738589dee9ee0f14e1cec812770e git-subtree-split: fad6a1066616b69d7f5fef01178efdf014c59537
Diffstat (limited to 'meshmc/.github/workflows/nix.yml')
-rw-r--r--meshmc/.github/workflows/nix.yml138
1 files changed, 138 insertions, 0 deletions
diff --git a/meshmc/.github/workflows/nix.yml b/meshmc/.github/workflows/nix.yml
new file mode 100644
index 0000000000..a62d9c0aff
--- /dev/null
+++ b/meshmc/.github/workflows/nix.yml
@@ -0,0 +1,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"