-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (36 loc) · 1.56 KB
/
redlib.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
name: Redlib build
on: [workflow_dispatch]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- run: sudo apt-get install -y git tar zip mingw-w64
- uses: brndnmtthws/[email protected]
with:
targets: x86_64-unknown-linux-gnu x86_64-pc-windows-gnu
- run: |
mkdir redlib
cd redlib/
REPO=https://github.com/redlib-org/redlib/
git clone $REPO --single-branch --branch $(git ls-remote --tags $REPO | cut -d/ -f3 | sort -V | tail -n1)
cd redlib/
cargo build --target x86_64-unknown-linux-gnu --release
mv target/x86_64-unknown-linux-gnu/release/redlib ../redlib_linux_x86_64
cargo build --target x86_64-pc-windows-gnu --release
mv target/x86_64-pc-windows-gnu/release/redlib.exe ../redlib_windows_x86_64.exe
cd ../../
tar -czvf redlib_linux_x86_64.tar.gz ./redlib/redlib_linux_x86_64
zip redlib_windows_x86_64.zip ./redlib/redlib_windows_x86_64.exe
mv redlib_linux_x86_64.tar.gz binaries/
mv redlib_windows_x86_64.zip binaries/
rm -fr redlib/
- run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Update RedLib binaries"
- uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main