-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (92 loc) · 3.39 KB
/
build.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
119
120
121
name: Build
on:
push:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}
cancel-in-progress: true
steps:
# Checkout repo
- uses: actions/checkout@v3
# Install required packages
- name: Install required packages (Linux only)
uses: awalsh128/cache-apt-pkgs-action@latest
if: runner.os == 'Linux'
with:
packages: libsdl2-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libatk1.0-dev gir1.2-gtk-3.0 libasound2-dev
version: 1.0
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
default: true
override: true
# cache rust
- uses: Swatinem/rust-cache@v2
# install cargo packages...
- name: Install cargo-deb
if: runner.os == 'Linux'
run: cargo install cargo-deb
# Build yarge-frontend-desktop
- name: Build
run: cargo build -p yarge-frontend-desktop --profile production
# Create yarge-frontend-desktop deb
- name: Create a binary .deb package for yarge-frontend-desktop (Linux only)
if: runner.os == 'Linux'
run: cargo deb -p yarge-frontend-desktop --strip --no-build --profile production --output "./yarge-frontend-desktop.deb"
# Upload build artifacts
- name: Upload Windows build artifact
uses: actions/upload-artifact@v3
if: runner.os == 'Windows'
with:
name: release-win64
path: ./target/production/yarge-frontend-desktop.exe
- name: Upload Linux build artifact
uses: actions/upload-artifact@v3
if: runner.os == 'Linux'
with:
name: release-lin64
path: ./target/production/yarge-frontend-desktop
- name: Upload yarge-frontend-desktop Debian package
uses: actions/upload-artifact@v3
if: runner.os == 'Linux'
with:
name: release-lin64-deb
path: ./yarge-frontend-desktop.deb
# Build yarge-frontend-sdl
# - name: Setup cargo vcpkg
# run: cargo install cargo-vcpkg
# - name: Build vcpkg packages
# run: cd yarge-frontend-sdl; cargo vcpkg --verbose build --manifest-path ./Cargo.toml; cd ..;
- name: Build yarge-frontend-sdl
run: cargo build -p yarge-frontend-sdl --profile production --features production
- name: Create a binary .deb package for yarge-frontend-sdl (Linux only)
if: runner.os == 'Linux'
run: cargo deb -p yarge-frontend-sdl --strip --no-build --profile production --output "./yarge-frontend-sdl.deb"
- name: Upload sdl Windows build artifact
uses: actions/upload-artifact@v3
if: runner.os == 'Windows'
with:
name: sdl-release-win64
path: ./target/production/yarge-frontend-sdl.exe
- name: Upload sdl Linux build artifact
uses: actions/upload-artifact@v3
if: runner.os == 'Linux'
with:
name: sdl-release-lin64
path: ./target/production/yarge-frontend-sdl
- name: Upload sdl Debian package
uses: actions/upload-artifact@v3
if: runner.os == 'Linux'
with:
name: sdl-release-lin64-deb
path: ./yarge-frontend-sdl.deb