-
-
Notifications
You must be signed in to change notification settings - Fork 117
162 lines (139 loc) · 4.53 KB
/
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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Release builds for Mac(64bit, Arm), Windows and Linux(64 bit, Arm)
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
paths-ignore:
- "docs/**"
- "helm/**"
- "assets/**"
- "**.md"
jobs:
build-linux:
name: Build for ${{matrix.target}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- aarch64-unknown-linux-gnu # linux(arm)
- x86_64-unknown-linux-gnu # linux(64 bit)
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal # minimal component installation (ie, no documentation)
target: ${{matrix.target}}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{matrix.target}}
- name: Rename binary
run: |
mv target/${{ matrix.target }}/release/parseable Parseable_${{ matrix.target }}
- name: Create Artifact
uses: actions/upload-artifact@v3
with:
name: Parseable_oss_${{ matrix.target }}
path: Parseable_oss_${{ matrix.target }}
- name: Publish Archive to Release Page
uses: softprops/[email protected]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
draft: false
files: Parseable_oss_${{ matrix.target }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
override: true
- name: Build
run: cargo build --all --release --target x86_64-pc-windows-msvc
- name: Rename binary
run: |
mv target/x86_64-pc-windows-msvc/release/PARSEABLE.exe Parseable_oss_x86_64-pc-windows-msvc.exe
- name: Create artifact for Windows
uses: actions/upload-artifact@v2
with:
name: Parseable_oss_x86_64-pc-windows-msvc.exe
path: Parseable_oss_x86_64-pc-windows-msvc.exe
- name: Publish Archive to Release Page
uses: softprops/[email protected]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
draft: false
files: Parseable_oss_x86_64-pc-windows-msvc.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-mac:
runs-on: macos-latest
strategy:
matrix:
target:
- aarch64-apple-darwin
- x86_64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: ${{ matrix.target }}
default: true
override: true
- name: Build
run: |
cargo build --release --target ${{ matrix.target }}
strip target/${{ matrix.target }}/release/Parseable
- name: Rename binary
run: |
mv target/${{ matrix.target }}/release/Parseable Parseable_oss_${{ matrix.target }}
- name: Create artifact
uses: actions/upload-artifact@v2
with:
name: Parseable_oss_${{ matrix.target }}
path: Parseable_oss_${{ matrix.target }}
- name: Publish Archive to Release Page
uses: softprops/[email protected]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
draft: false
files: Parseable_oss_${{ matrix.target }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
create-checksum:
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-mac]
steps:
- name: Download artifacts created
uses: actions/download-artifact@v3
- name: Run shasum command
run: |
find . -type f -name "Parseable_oss_*" -exec shasum {} \; | sed 's/.\/.*\///' > checksum.txt
- name: Create artifact
uses: actions/upload-artifact@v2
with:
name: checksum.txt
path: checksum.txt
- name: Publish Check Sum to Release Page
uses: softprops/[email protected]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
draft: false
files: checksum.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}