2022-10-04 16:32:44 +00:00
|
|
|
name: Nix
|
|
|
|
|
2023-05-30 18:44:47 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-07-25 11:37:43 +00:00
|
|
|
pull_request:
|
|
|
|
types: [ labeled ]
|
2022-10-04 16:32:44 +00:00
|
|
|
|
2023-03-30 20:14:06 +00:00
|
|
|
# Setting the shell option, it will run 'bash --noprofile --norc -eo pipefail {0}'
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2022-10-04 16:32:44 +00:00
|
|
|
jobs:
|
2023-12-05 19:20:29 +00:00
|
|
|
# TODO: Figure out why it fails to build
|
|
|
|
#
|
|
|
|
# build-static:
|
|
|
|
# name: Build static Linux binary
|
|
|
|
# if: ${{ github.ref == 'refs/heads/main' }} || ${{ github.event.label.name == 'nix' }}
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# steps:
|
2024-03-18 09:29:19 +00:00
|
|
|
# - uses: actions/checkout@v4
|
|
|
|
# - uses: cachix/install-nix-action@v26
|
|
|
|
# - uses: cachix/cachix-action@v14
|
2023-12-05 19:20:29 +00:00
|
|
|
# with:
|
|
|
|
# name: surrealdb
|
|
|
|
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
|
|
# extraPullNames: nix-community
|
|
|
|
# - run: nix build .#static-binary
|
|
|
|
# - run: ./result/bin/surreal help
|
2022-10-04 16:32:44 +00:00
|
|
|
|
|
|
|
build-docker:
|
|
|
|
name: Build Docker image
|
2023-07-25 21:36:31 +00:00
|
|
|
if: ${{ github.ref == 'refs/heads/main' }} || ${{ github.event.label.name == 'nix' }}
|
2022-10-04 16:32:44 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-12-05 11:52:09 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-03-18 09:29:19 +00:00
|
|
|
- uses: cachix/install-nix-action@v26
|
|
|
|
- uses: cachix/cachix-action@v14
|
2022-10-04 16:32:44 +00:00
|
|
|
with:
|
|
|
|
name: surrealdb
|
|
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
|
|
extraPullNames: nix-community
|
|
|
|
- run: nix build .#docker-image
|
|
|
|
- run: docker load --input ./result
|
|
|
|
|
|
|
|
build-native-linux:
|
|
|
|
name: Build native Linux binary
|
2023-07-25 21:36:31 +00:00
|
|
|
if: ${{ github.ref == 'refs/heads/main' }} || ${{ github.event.label.name == 'nix' }}
|
2022-10-04 16:32:44 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-12-05 11:52:09 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-03-18 09:29:19 +00:00
|
|
|
- uses: cachix/install-nix-action@v26
|
|
|
|
- uses: cachix/cachix-action@v14
|
2022-10-04 16:32:44 +00:00
|
|
|
with:
|
|
|
|
name: surrealdb
|
|
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
|
|
extraPullNames: nix-community
|
|
|
|
- run: nix build .#x86_64-unknown-linux-gnu
|
|
|
|
- run: ./result/bin/surreal help
|