-
Notifications
You must be signed in to change notification settings - Fork 14
136 lines (133 loc) · 4.01 KB
/
rust.yml
File metadata and controls
136 lines (133 loc) · 4.01 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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
release:
types: [published]
env:
CARGO_TERM_COLOR: always
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Build Rust
run: cargo build --verbose --release
- name: Copy Dependencies
run: cp ./resources/aria2c.exe ./target/release/aria2c.exe && cp ./resources/sciter.dll ./target/release/sciter.dll
- name: Create Windows zip
run: |
$VERSION = "${{ github.ref_name }}".Substring(1)
Compress-Archive -Path ./target/release/cele-mod.exe,./target/release/aria2c.exe,./target/release/sciter.dll -DestinationPath "celemod-${VERSION}-windows.zip"
echo "VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: actions/upload-artifact@v4.3.1
with:
name: windows-exe
path: ./target/release/cele-mod.exe
- uses: actions/upload-artifact@v4.3.1
with:
name: windows-zip
path: celemod-${{ env.VERSION }}-windows.zip
build-linux:
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo sh -c 'echo "deb http://archive.ubuntu.com/ubuntu focal-updates main" > /etc/apt/sources.list.d/focal-updates.list'
sudo apt-get update
sudo apt-get install -y \
pkg-config \
cmake \
clang \
libpango-1.0-0 \
libatk1.0-dev \
libgtk-3-dev
- uses: actions/checkout@v3
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Build Rust
run: cargo build --verbose --release
- name: Create Linux zip
run: |
VERSION=${{ github.ref_name }}
VERSION=${VERSION#v}
zip "celemod-${VERSION}-linux.zip" ./target/release/cele-mod
echo "VERSION=$VERSION" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4.3.1
with:
name: linux-zip
path: celemod-${{ env.VERSION }}-linux.zip
build-osx:
runs-on: macos-latest
steps:
- name: Install dependencies
run: |
brew install pango
brew install gtk+3
brew install protobuf
- uses: actions/checkout@v3
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Build Rust
run: cargo build --verbose --release
- name: Create OSX zip
run: |
VERSION=${{ github.ref_name }}
VERSION=${VERSION#v}
zip "celemod-${VERSION}-osx.zip" ./target/release/cele-mod
echo "VERSION=$VERSION" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4.3.1
with:
name: osx-zip
path: celemod-${{ env.VERSION }}-osx.zip
release:
runs-on: ubuntu-latest
needs: [build-windows, build-linux, build-osx]
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v4
with:
name: windows-exe
path: .
- uses: actions/download-artifact@v4
with:
name: windows-zip
path: .
- uses: actions/download-artifact@v4
with:
name: linux-zip
path: .
- uses: actions/download-artifact@v4
with:
name: osx-zip
path: .
- name: Prepare release files
run: |
VERSION=${{ github.ref_name }}
VERSION=${VERSION#v}
mv cele-mod.exe "cele-mod-no-dependencies-${VERSION}.exe"
- uses: softprops/action-gh-release@v1
with:
files: |
cele-mod-no-dependencies-${VERSION}.exe
celemod-${VERSION}-windows.zip
celemod-${VERSION}-linux.zip
celemod-${VERSION}-osx.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}