Skip to content

Build

Build #191

Workflow file for this run

name: Build
on:
push:
workflow_dispatch:
inputs:
version:
description: "Release version"
required: true
defaults:
run:
shell: nix develop -v -c bash {0}
jobs:
build:
name: Build
runs-on: [self-hosted, nix, general, "${{ matrix.arch.runner }}", small]
strategy:
fail-fast: false
matrix:
arch:
- nix: x86_64-linux
runner: amd64-linux
- nix: aarch64-linux
runner: arm64-linux
- nix: aarch64-darwin
runner: arm64-darwin
steps:
- uses: actions/checkout@v4
- name: Set version
if: github.event.inputs.version
run: ./cli.sh set_version "${{ github.event.inputs.version }}"
- name: Check
run: nix develop -v -c ./cli.sh code_quality
- name: Build
run: nix build -L -v --no-link '.#defaultPackage.${{ matrix.arch.nix }}'
- name: Cache
env:
NIX_OUTPUT: .#defaultPackage.${{ matrix.arch.nix }}
run: |
nix store sign "${NIX_OUTPUT}" -v -r -k ~/.secrets/nix-cache-private-key
nix copy -v --to "s3://${NIX_CACHE_BUCKET_NAME}/cache?region=${NIX_CACHE_BUCKET_REGION}&compression=zstd&parallel-compression=true" "${NIX_OUTPUT}"
release:
name: Release
if: github.event.inputs.version
needs: [build]
runs-on: [self-hosted, nix, general, arm64-linux, small]
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set version to ${{ github.event.inputs.version }}
run: ./cli.sh set_version "${{ github.event.inputs.version }}"
- name: Publish to JSR
run: ./cli.sh jsr_publish
- name: Release ${{ github.event.inputs.version }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./cli.sh create_release "${{ github.event.inputs.version }}"