-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (57 loc) · 1.7 KB
/
release.yaml
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
name: build release
on: [push]
jobs:
build_release:
strategy:
matrix:
include:
- os: ubuntu-latest
bin: esdump-rs
target: x86_64-unknown-linux-gnu
suffix: tar.gz
- os: macOS-latest
bin: esdump-rs
target: aarch64-apple-darwin.tar
suffix: tar.gz
- os: windows-latest
bin: esdump-rs.exe
target: x86_64-pc-windows-msvc
suffix: zip
name: cargo build
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: "release-lto"
- run: cargo build --target=${{ matrix.target }} --profile=release-lto
- run: mkdir ${{ matrix.target }}
- run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]
then
7z a ${{ matrix.target}}.${{ matrix.suffix }} target/${{ matrix.target }}/release-lto/${{ matrix.bin }}
else
tar czvf ${{ matrix.target}}.${{ matrix.suffix }} target/${{ matrix.target }}/release-lto/${{ matrix.bin }}
fi
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target}}.${{ matrix.suffix }}
path: ${{ matrix.target}}.${{ matrix.suffix }}
retention-days: 1
#
# create_release:
# name: Release
# runs-on: ubuntu-latest
# needs:
# - build_release
# steps:
# - uses: actions/download-artifact@v4
# - name: Publish
# uses: softprops/action-gh-release@v1
# with:
# draft: false
# files: |
# **/*.tar.gz
# **/*.zip