-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (77 loc) · 2.7 KB
/
ci.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
90
91
92
93
94
95
96
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]
env:
CARGO_TERM_COLOR: always
jobs:
build-mac-win:
name: Build for ${{ matrix.os }}
strategy:
matrix:
os: [x86_64-apple-darwin, x86_64-pc-windows-gnu] # x86_64-unknown-linux-gnu]
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Add targets
run: rustup target add ${{ matrix.os }}
- name: Install x86_64-w64-mingw32-gcc
run: brew install mingw-w64
if: matrix.os == 'x86_64-pc-windows-gnu'
- name: Build for ${{ matrix.os }}
uses: actions-rs/cargo@v1
with:
command: build
args: --target ${{ matrix.os }} --release
- name: Move octool from target/${{ matrix.os }}/release/octool to .
run: mv target/${{ matrix.os }}/release/octool* .
- name: Create zip archive for ${{ matrix.os }} build
run: zip ${{ matrix.os }}.zip octool octool.exe README.md LICENSE tool_config_files/octool_config.json
- name: "Upload to artifacts"
if: always()
uses: actions/upload-artifact@v3
with:
name: "${{ matrix.os }}"
path: "${{ matrix.os }}.zip"
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@133984371c30d34e38222a64855679a414cb7575
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.os }}.zip
tag: ${{ github.ref }}
file_glob: true
build-linux:
name: Build for x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Add targets
run: rustup target add x86_64-unknown-linux-gnu
- name: Build for x86_64-unknown-linux-gnu
uses: actions-rs/cargo@v1
with:
command: build
args: --target x86_64-unknown-linux-gnu --release
- name: Move octool from target/x86_64-unknown-linux-gnu/release/octool to .
run: mv target/x86_64-unknown-linux-gnu/release/octool .
- name: Create zip archive for x86_64-unknown-linux-gnu build
run: zip x86_64-unknown-linux-gnu.zip octool README.md LICENSE tool_config_files/octool_config.json
- name: "Upload to artifacts"
if: always()
uses: actions/upload-artifact@v3
with:
name: "x86_64-unknown-linux-gnu"
path: "x86_64-unknown-linux-gnu.zip"
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@133984371c30d34e38222a64855679a414cb7575
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: x86_64-unknown-linux-gnu.zip
tag: ${{ github.ref }}
file_glob: true