-
Notifications
You must be signed in to change notification settings - Fork 77
93 lines (77 loc) · 2.37 KB
/
release.yml
File metadata and controls
93 lines (77 loc) · 2.37 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
90
91
92
93
name: Build and Release Nova CLI
on:
workflow_dispatch:
push:
branches: [main]
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.asset-name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux (x86_64)
- os: ubuntu-latest
rust-target: x86_64-unknown-linux-gnu
asset-name: nova-linux-amd64
# Linux (ARM)
- os: ubuntu-24.04-arm
rust-target: aarch64-unknown-linux-gnu
asset-name: nova-linux-arm64
# macOS (Intel)
- os: macos-15-intel
rust-target: x86_64-apple-darwin
asset-name: nova-macos-amd64
# macOS (Apple Silicon/ARM)
- os: macos-latest
rust-target: aarch64-apple-darwin
asset-name: nova-macos-arm64
# Windows
- os: windows-latest
rust-target: x86_64-pc-windows-msvc
asset-name: nova-windows-amd64.exe
steps:
- uses: actions/checkout@v3
- name: Install the rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.rust-target }}
- name: Build
run: cargo build --release --target ${{ matrix.rust-target }} --bin nova_cli
- name: Prepare binary
shell: bash
run: |
cd target/${{ matrix.rust-target }}/release/
if [ "${{ matrix.os }}" = "windows-latest" ]; then
mv nova_cli.exe ${{ matrix.asset-name }}
else
mv nova_cli ${{ matrix.asset-name }}
fi
- name: Upload Binary as Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset-name }}
path: target/${{ matrix.rust-target }}/release/${{ matrix.asset-name }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Create Draft Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./artifacts/*/nova-*
file_glob: true
draft: true
tag: latest
overwrite: true