-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (94 loc) · 2.78 KB
/
rust.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
name: Rust
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends build-essential ninja-build libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo
target
key: linux-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: linux-cargo-${{ hashFiles('Cargo.lock') }}
- name: Install Cargo bundle
run: cargo install cargo-bundle
- name: Build
run: cargo build --verbose --release
- name: Build mkpsxiso
run: |
cmake --preset ci -S ./mkpsxiso -B ./mkpsxiso/build
cmake --build ./mkpsxiso/build --config Release
- name: Bundle
run: cargo bundle --release --format deb
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dmw3-randomizer-linux
path: target/release/bundle/deb/*.deb
build-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache
uses: actions/cache@v3
with:
path: |
$HOME/.cargo
target
key: windows-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: windows-cargo-${{ hashFiles('Cargo.lock') }}
- name: Build
run: cargo build --verbose --release
- name: Build mkpsxiso
run: |
cmake --preset ci -S ./mkpsxiso -B ./mkpsxiso/build -G "Visual Studio 17 2022"
cmake --build ./mkpsxiso/build --config Release
- name: Construct artifact
run: |
mkdir artifact
xcopy assets\ artifact\assets /i
xcopy target\release\*.exe artifact\
xcopy mkpsxiso\build\Release\*.exe artifact\
Compress-Archive -Path artifact\* -DestinationPath dmw3-randomizer-windows.zip
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dmw3-randomizer-windows
path: dmw3-randomizer-windows.zip
create-release:
name: Create release
runs-on: ubuntu-latest
needs: [ build-windows, build-linux ]
steps:
- name: Fetch build artifacts
if: ${{ github.ref_type == 'tag' }}
uses: actions/download-artifact@v3
with:
path: .
- name: Publish release
if: ${{ github.ref_type == 'tag' }}
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
files: |
dmw3-randomizer-linux/*
dmw3-randomizer-windows/*