summaryrefslogtreecommitdiffstats
path: root/.github/workflows/release.yml
blob: 087cf62833a30887b79743ef2de4917f4a4d300d (plain)
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
name: "Build"

on: [push]

# on:
#   release:
#     types: [created]

jobs:
  build:
    runs-on: '${{ matrix.os }}'
    name: "Build ${{ matrix.target }}"
    strategy:
      max-parallel: 2
      matrix:
        include:
          - os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
            suffix: ""
          - os: windows-latest
            target: x86_64-pc-windows-msvc
            suffix: ".exe"
          # - os: macos-latest
          #   target: x86_64-apple-darwin
          #   suffix: ""

    steps:
      - uses: actions/checkout@v3

      - uses: actions/cache@v3
        with:
          path: ~/.cargo/registry
          key: '${{ runner.os }}-cargo-registry-${{ hashFiles(''**/Cargo.lock'') }}'
      - uses: actions/cache@v3
        with:
          path: ~/.cargo/git
          key: '${{ runner.os }}-cargo-index-${{ hashFiles(''**/Cargo.lock'') }}'
      - uses: actions/cache@v3
        with:
          path: target
          key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

      - name: Install nightly
        uses: actions-rs/toolchain@v1
        with:
            toolchain: nightly
            override: true
            target: ${{ matrix.target }}

      - name: Run cargo build --release
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --release

      - name: Archive Binaries
        uses: actions/upload-artifact@v3
        with:
          name: ${{ matrix.target }}
          path: ./target/release/svgbob${{ matrix.suffix}}