forked from tryandromeda/andromeda
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.33 KB
/
release.yml
File metadata and controls
80 lines (68 loc) · 2.33 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
name: Build and Release Andromeda
on:
push:
branches: [ main ]
tags:
- 'v*'
jobs:
build:
name: Build and Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux (x86_64)
- os: ubuntu-latest
rust-target: x86_64-unknown-linux-gnu
asset-name: andromeda-linux-amd64
# macOS (Intel)
- os: macos-latest
rust-target: x86_64-apple-darwin
asset-name: andromeda-macos-amd64
# macOS (Apple Silicon/ARM)
- os: macos-latest
rust-target: aarch64-apple-darwin
asset-name: andromeda-macos-arm64
# Windows
- os: windows-latest
rust-target: x86_64-pc-windows-msvc
asset-name: andromeda-windows-amd64.exe
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.rust-target }}
- uses: Swatinem/rust-cache@v2
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.rust-target }} --manifest-path ./cli/Cargo.toml
- name: Prepare binary
shell: bash
run: |
cd target/${{ matrix.rust-target }}/release/
if [ "${{ matrix.os }}" = "windows-latest" ]; then
mv andromeda.exe ${{ matrix.asset-name }}
else
mv andromeda ${{ matrix.asset-name }}
fi
- name: Upload Binary to Release (Tag Only)
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.rust-target }}/release/${{ matrix.asset-name }}
asset_name: ${{ matrix.asset-name }}
tag: ${{ github.ref }}
overwrite: true
- name: Upload Binary as Artifact (Main Branch)
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset-name }}
path: target/${{ matrix.rust-target }}/release/${{ matrix.asset-name }}