Skip to content

feat: initialize direnv for nix #5

feat: initialize direnv for nix

feat: initialize direnv for nix #5

Workflow file for this run

# note: vert-windows is actually a linux machine
# it is the same machine and environment as vert-linux
# the only reason it exists is to allow for parallel
# builds on the same machine, to massively boost build
# times -- gh actions only allows 1 job per machine
name: Build and Release
on:
push:
branches: ["main"]
tags: ["v*"]
paths:
- "src/**"
- "Cargo.toml"
- "Cargo.lock"
pull_request:
branches: ["main"]
paths:
- "src/**"
- "Cargo.toml"
- "Cargo.lock"
workflow_dispatch:
jobs:
build:
name: Build on ${{ matrix.os }} (${{ matrix.target }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
matrix:
include:
# macOS (github-hosted)
- os: macos-latest
friendly-name: mac-arm64
target: aarch64-apple-darwin
- os: macos-latest
friendly-name: mac-x86_64
target: x86_64-apple-darwin
# Linux (self-hosted)
- os: vert-linux
friendly-name: linux-x86_64
target: x86_64-unknown-linux-gnu
# Windows (self-hosted)
- os: vert-windows
friendly-name: windows-x86_64
target: x86_64-pc-windows-gnu
format: ".exe"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --target ${{ matrix.target }} --release
- name: Upload
uses: actions/upload-artifact@v4
with:
path: target/${{ matrix.target }}/release/vertd${{ matrix.format }}
name: vertd-${{ matrix.friendly-name }}${{ matrix.format }}
release:
name: Publish release
needs: build # wait for all builds to finish
runs-on: vert-linux
permissions:
contents: write # necessary for releases?
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Move and rename artifacts
run: |
mkdir -p artifacts/output
for dir in artifacts/vertd-*; do
[ -d "$dir" ] || continue
bin_name=$(basename "$dir")
mv "$dir"/* "artifacts/output/$bin_name"
done
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: nightly-${{ github.sha }}
name: "Nightly build #${{ github.run_number }}"
draft: false
prerelease: false
files: artifacts/output/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}