Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
include:
- system: x86_64-linux
package: default
runner: ubuntu-latest
runner: [self-hosted, nix]
artifact: brainpod-amd64-linux
archive: brainpod-amd64-linux.tar.gz
- system: x86_64-darwin
Expand All @@ -39,18 +39,20 @@ jobs:
archive: brainpod-arm64-macos.tar.gz
- system: x86_64-linux
package: windows
runner: ubuntu-latest
runner: [self-hosted, nix]
artifact: brainpod-amd64-windows
archive: brainpod-amd64-windows.zip

steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v31
if: matrix.system != 'x86_64-linux'
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Restore and save Nix store
if: matrix.system != 'x86_64-linux'
uses: nix-community/cache-nix-action@v7
with:
primary-key: nix-v1-${{ matrix.system }}-${{ matrix.package }}-${{ hashFiles('flake.nix', 'flake.lock', 'Cargo.lock') }}
Expand All @@ -73,7 +75,7 @@ jobs:
mkdir package
cp -L result/bin/brainpod.exe package/brainpod.exe
cd package
zip "../${{ matrix.archive }}" brainpod.exe
nix shell --inputs-from "$GITHUB_WORKSPACE" nixpkgs#zip --command zip "../${{ matrix.archive }}" brainpod.exe

- name: Publish artifact
uses: actions/upload-artifact@v4
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/flake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ permissions:
jobs:
check:
name: Check
runs-on: ubuntu-latest
runs-on: [self-hosted, nix]

steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Check flake
run: nix flake check --all-systems --no-build
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
include:
- system: x86_64-linux
package: default
runner: ubuntu-latest
runner: [self-hosted, nix]
artifact: brainpod-amd64-linux
archive: brainpod-amd64-linux.tar.gz
- system: x86_64-darwin
Expand All @@ -38,18 +38,20 @@ jobs:
archive: brainpod-arm64-macos.tar.gz
- system: x86_64-linux
package: windows
runner: ubuntu-latest
runner: [self-hosted, nix]
artifact: brainpod-amd64-windows
archive: brainpod-amd64-windows.zip

steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v31
if: matrix.system != 'x86_64-linux'
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Restore and save Nix store
if: matrix.system != 'x86_64-linux'
uses: nix-community/cache-nix-action@v7
with:
primary-key: nix-v1-${{ matrix.system }}-${{ matrix.package }}-${{ hashFiles('flake.nix', 'flake.lock', 'Cargo.lock') }}
Expand All @@ -72,7 +74,7 @@ jobs:
mkdir package
cp -L result/bin/brainpod.exe package/brainpod.exe
cd package
zip "../${{ matrix.archive }}" brainpod.exe
nix shell --inputs-from "$GITHUB_WORKSPACE" nixpkgs#zip --command zip "../${{ matrix.archive }}" brainpod.exe

- name: Publish artifact
uses: actions/upload-artifact@v4
Expand All @@ -84,11 +86,13 @@ jobs:
publish:
name: Attach binaries to release
needs: build
runs-on: ubuntu-latest
runs-on: [self-hosted, nix]
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Download binaries
uses: actions/download-artifact@v4
with:
Expand All @@ -105,4 +109,4 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TAG: ${{ github.event.release.tag_name }}
run: gh release upload "$TAG" *.tar.gz *.zip SHA256SUMS --clobber
run: nix shell --inputs-from "$GITHUB_WORKSPACE" nixpkgs#gh --command gh release upload "$TAG" *.tar.gz *.zip SHA256SUMS --clobber
Loading