-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (68 loc) · 2.73 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
name: Build
on:
release:
types: [created, edited]
workflow_dispatch:
jobs:
release:
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-latest
rust_target: x86_64-unknown-linux-gnu
- platform: macos-latest
rust_target: x86_64-apple-darwin
- platform: macos-latest
rust_target: aarch64-apple-darwin
- platform: windows-latest
rust_target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust (Stable)
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Build App (windows)
run: |
cargo build --release
mv ./target/release/escaper.exe "./target/release/escaper-${{ matrix.rust_target }}.exe"
if: matrix.platform == 'windows-latest'
continue-on-error: true
- name: Build App (unix)
run: |
cargo build --release
mv ./target/release/escaper "./target/release/escaper-${{ matrix.rust_target }}"
if: matrix.platform != 'windows-latest'
continue-on-error: true
- name: Run UPX (Windows)
uses: crazy-max/ghaction-upx@v3
with:
version: latest
files: |
"./target/release/escaper-${{ matrix.rust_target }}*"
args: --best
- name: Upload Release Assets (windows)
id: upload-release-asset-windows
uses: softprops/action-gh-release@v1
if: matrix.platform == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
draft: false
prerelease: false
files: |
./target/release/escaper*.exe
- name: Upload Release Assets (unix)
id: upload-release-unix
uses: softprops/action-gh-release@v1
if: matrix.platform != 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
draft: false
prerelease: false
files: |
./target/release/escaper-${{ matrix.rust_target }}