forked from neosmart/tac
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (70 loc) · 2.45 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
70
71
72
73
74
75
76
77
78
79
80
81
name: Build
on: [workflow_call, workflow_dispatch]
jobs:
build:
env:
RUSTFLAGS: "-D warnings"
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: i686-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: i686-pc-windows-msvc
- os: ubuntu-latest
target: x86_64-unknown-freebsd
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.os == 'ubuntu-latest'
uses: taiki-e/install-action@cross
- name: Build
if: matrix.os == 'ubuntu-latest'
run: cross build --release --locked --target ${{ matrix.target }}
- name: Build
if: matrix.os != 'ubuntu-latest'
run: cargo build --release --locked --target ${{ matrix.target }}
- name: Archive
if: matrix.os == 'windows-latest'
run: |
copy target\${{ matrix.target }}\release\tac.exe tac.exe
7z a tac-k_${{ matrix.target }}.zip tac.exe README.md CONTRIBUTORS.md LICENSE-MIT LICENSE-APACHE
- name: Archive
if: matrix.os != 'windows-latest'
run: |
cp target/${{ matrix.target }}/release/tac tac
tar czvf tac-k_${{ matrix.target }}.tar.gz tac README.md CONTRIBUTORS.md LICENSE-MIT LICENSE-APACHE
- name: Upload Artifact
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: tac-k_${{ matrix.target }}.zip
path: tac-k_${{ matrix.target }}.zip
if-no-files-found: error
- name: Upload Artifact
if: matrix.os != 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: tac-k_${{ matrix.target }}.tar.gz
path: tac-k_${{ matrix.target }}.tar.gz
if-no-files-found: error