fix: guess we're not supporting arm linux or windows huh #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} (${{ matrix.target }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
# macOS | |
- os: vert-mac | |
friendly-name: mac-arm64 | |
target: aarch64-apple-darwin | |
- os: vert-mac | |
friendly-name: mac-x86_64 | |
target: x86_64-apple-darwin | |
# Linux | |
- os: vert-linux | |
friendly-name: linux-x86_64 | |
target: x86_64-unknown-linux-gnu | |
- os: vert-linux | |
friendly-name: linux-x86 | |
target: i686-unknown-linux-gnu | |
# Windows | |
- os: vert-windows | |
friendly-name: windows-x86_64 | |
target: x86_64-pc-windows-gnu | |
format: ".exe" | |
- os: vert-windows | |
friendly-name: windows-x86 | |
target: i686-pc-windows-gnu | |
format: ".exe" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- 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 }} |