-
Notifications
You must be signed in to change notification settings - Fork 21
90 lines (82 loc) · 2.51 KB
/
tool.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
82
83
84
85
86
87
88
89
name: PicoROM Tool CI
on:
push:
branches:
- main
tags:
- '*'
paths:
- 'host/**'
- '.github/workflows/tool.yml'
pull_request:
paths:
- 'host/**'
- '.github/workflows/tool.yml'
workflow_dispatch:
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
GH_TOKEN: '${{ github.token }}'
jobs:
build:
name: Build
strategy:
matrix:
include:
- target: x86_64-apple-darwin
host: macos-latest
cross: false
- target: x86_64-pc-windows-msvc
host: windows-latest
cross: false
- target: aarch64-apple-darwin
host: macos-latest
cross: false
- target: armv7-unknown-linux-musleabihf
host: ubuntu-latest
cross: true
- target: x86_64-unknown-linux-musl
host: ubuntu-latest
cross: true
runs-on: ${{ matrix.host }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- run: cargo install cross --git https://github.com/cross-rs/cross
if: ${{ matrix.cross }}
- run: cross build --release --target ${{ matrix.target }} --manifest-path host/picorom/Cargo.toml --target-dir target
if: ${{ matrix.cross }}
- run: cargo build --release --target ${{ matrix.target }} --manifest-path host/picorom/Cargo.toml --target-dir target
if: ${{ !matrix.cross }}
- run: |
mkdir artifacts
cp target/${{ matrix.target }}/release/picorom.exe artifacts/picorom-${{ matrix.target }}.exe
cp target/${{ matrix.target }}/release/picorom.pdb artifacts/picorom-${{ matrix.target }}.pdb
if: ${{ matrix.host == 'windows-latest' }}
- run: |
mkdir artifacts
cp target/${{ matrix.target }}/release/picorom artifacts/picorom-${{ matrix.target }}
if: ${{ matrix.host != 'windows-latest' }}
- uses: actions/upload-artifact@v4
with:
name: picorom-${{ matrix.target }}
path: artifacts/*
if-no-files-found: error
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [build]
steps:
- uses: actions/download-artifact@v4
with:
pattern: picorom-*
merge-multiple: true
- name: Attach picorom
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
file: picorom*