-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 1.81 KB
/
build_and_release.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
name: Build and Release for Windows, Linux and MacOS
on:
push:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- target: x86_64-unknown-linux-gnu
bin: pre-commit
bin_name: pre-commit_upordawn
os: ubuntu-latest
- target: x86_64-apple-darwin
bin: pre-commit
bin_name: pre-commit_upordawn
os: macOS-latest
- target: x86_64-pc-windows-gnu
bin: pre-commit.exe
bin_name: pre-commit_upordawn.exe
os: windows-latest
- target: i686-pc-windows-msvc
bin: pre-commit.exe
bin_name: pre-commit_upordawn.exe
os: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.platform.target }}
override: true
- name: Build
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.platform.target }}
args: "--release"
- name: Create target dir & Move binary
run: |
mkdir -p release_assets/${{ matrix.platform.os }}
mv target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin_name }} release_assets/${{ matrix.platform.os }}/${{ matrix.platform.bin }}
- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.token }}
files: release_assets/${{ matrix.platform.os }}/${{ matrix.platform.bin }}
body: |
Release for ${{ matrix.platform.os }} target ${{ matrix.platform.target }}
tag_name: ${{ matrix.platform.target }}
draft: false
prerelease: false