-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (61 loc) · 1.91 KB
/
ci.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
name: CI
on:
push:
branches:
- action
tags:
- '*'
jobs:
build_and_release:
name: ulexec
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
target: x86_64-unknown-linux-musl
- name: Install deps
run: |
sudo bash -c 'apt update && apt install upx binutils gcc-mingw-w64 musl-tools -y'
rustup component add rust-src --toolchain nightly
cargo install cross
- name: Build x86_64
run: |
cargo clean
cargo build --release
mv target/x86_64-unknown-linux-musl/release/ulexec ulexec-x86_64
- name: Build aarch64
run: |
cargo clean
cross build --release --target aarch64-unknown-linux-musl
mv target/aarch64-unknown-linux-musl/release/ulexec ulexec-aarch64
# https://github.com/aunali1/super-strip
- name: Strip
run: |
"${{ github.workspace }}/.github/sstrip" ulexec-*
- name: UPX
run: |
ls ulexec-*|xargs -I {} upx -9 --best {} -o {}-upx
- name: Build x86_64 windows
run: |
cargo clean
cargo build --release --target x86_64-pc-windows-gnu
mv target/x86_64-pc-windows-gnu/release/ulexec.exe ulexec-x86_64.exe
upx --force -9 --best ulexec-x86_64.exe -o ulexec-x86_64-upx.exe
# - name: Build archlinux package
# uses: countstarlight/arch-makepkg-action@master
# with:
# scripts: "makepkg -fsCc --noconfirm"
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ulexec*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}