-
Notifications
You must be signed in to change notification settings - Fork 42
89 lines (79 loc) · 2.5 KB
/
Copy pathrust.yml
File metadata and controls
89 lines (79 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# 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 }}
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 }}