aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: 6abba75c648488905fcc152561c02097ded20e6b (plain) (blame)
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
name: Build
on:
  push:
    branches:
      - master

jobs:
  build:
    name: Build
    runs-on: ${{ matrix.config.os }}
    strategy:
      matrix:
        config:
          - {
            os: ubuntu-latest,
            artifact_name: t,
            asset_name: t-linux-amd64,
            strip: true
            }
          - {
            os: windows-latest,
            artifact_name: t.exe,
            asset_name: t-windows-amd64,
            strip: false
            }
          - {
            os: macos-latest,
            artifact_name: t,
            asset_name: t-macos-amd64,
            strip: true
            }
    steps:
      - uses: hecrj/setup-rust-action@v1
        with:
          rust-version: stable
      - uses: actions/checkout@v2
      - name: Build
        run: cargo build --release
      - name: Compress binaries
        uses: svenstaro/upx-action@v1-release
        with:
          file: target/release/${{ matrix.config.artifact_name }}
          args: '-9'
          strip: ${{ matrix.config.strip }}