-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (98 loc) · 4.35 KB
/
release.yml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: release
on:
push:
branches: ["mommy", "staging"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: -Zlocation-detail=none -Zthreads=8 -C debuginfo=0
strategy:
matrix:
include:
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: ${{ matrix.target }}
override: true
- name: Install rust-src
run: rustup component add rust-src --toolchain=nightly
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt install libasound2-dev libdbus-1-dev
- name: Download git submodules
run: git submodule update --remote --init --recursive
- name: Build Encore
run: cargo build --profile release --target ${{ matrix.target }} -Z build-std=std,panic_abort -Z build-std-features=optimize_for_size,panic_immediate_abort
- name: Zip Artifact (macOS x86_64)
if: matrix.os == 'macos-latest' && matrix.target == 'x86_64-apple-darwin'
run: zip encore_macos_x86_64.zip target/${{ matrix.target }}/release/encore
- name: Zip Artifact (macOS aarch64)
if: matrix.os == 'macos-latest' && matrix.target == 'aarch64-apple-darwin'
run: zip encore_macos_aarch64.zip target/${{ matrix.target }}/release/encore
- name: Zip Artifact (Linux x86_64)
if: matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu'
run: zip encore_linux_x86_64.zip target/${{ matrix.target }}/release/encore
# - name: Zip Artifact (Linux aarch64)
# if: matrix.os == 'ubuntu-latest' && matrix.target == 'aarch64-unknown-linux-gnu'
# run: zip encore_linux_aarch64.zip target/${{ matrix.target }}/release/encore -r
- name: Zip Artifact (Windows x86_64)
if: matrix.os == 'windows-latest' && matrix.target == 'x86_64-pc-windows-msvc'
run: Compress-Archive -Path target/${{ matrix.target }}/release/encore.exe -DestinationPath encore_windows_x86_64.zip # odd one out
- name: Zip Artifact (Windows aarch64)
if: matrix.os == 'windows-latest' && matrix.target == 'aarch64-pc-windows-msvc'
run: Compress-Archive -Path target/${{ matrix.target }}/release/encore.exe -DestinationPath encore_windows_aarch64.zip
- name: Artifact (macOS x86_64)
if: matrix.os == 'macos-latest' && matrix.target == 'x86_64-apple-darwin'
uses: actions/upload-artifact@v4
with:
name: encore (macOS x86_64)
path: encore_macos_x86_64.zip
- name: Artifact (macOS aarch64)
if: matrix.os == 'macos-latest' && matrix.target == 'aarch64-apple-darwin'
uses: actions/upload-artifact@v4
with:
name: encore (macOS aarch64)
path: encore_macos_aarch64.zip
- name: Artifact (Linux x86_64)
if: matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu'
uses: actions/upload-artifact@v4
with:
name: encore (Linux x86_64)
path: encore_linux_x86_64.zip
# - name: Artifact (Linux aarch64)
# if: matrix.os == 'ubuntu-latest' && matrix.target == 'aarch64-unknown-linux-gnu'
# uses: actions/upload-artifact@v4
# with:
# name: encore (Linux aarch64)
# path: encore_linux_aarch64.zip
- name: Artifact (Windows x86_64)
if: matrix.os == 'windows-latest' && matrix.target == 'x86_64-pc-windows-msvc'
uses: actions/upload-artifact@v4
with:
name: encore (Windows x86_64)
path: encore_windows_x86_64.zip
- name: Artifact (Windows aarch64)
if: matrix.os == 'windows-latest' && matrix.target == 'aarch64-pc-windows-msvc'
uses: actions/upload-artifact@v4
with:
name: encore (Windows aarch64)
path: encore_windows_aarch64.zip