feat: move uploading to vert-linux due to vm limitations #45
This file contains hidden or 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
name: Build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} (${{ matrix.target }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: vert-mac | |
friendly-name: mac-arm64 | |
target: aarch64-apple-darwin | |
format: "" | |
- os: vert-linux | |
friendly-name: linux-x86_64 | |
target: x86_64-unknown-linux-gnu | |
format: "" | |
- os: vert-linux | |
friendly-name: windows-x86_64 | |
target: x86_64-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 }} |