Skip to content

Commit fdd9ab7

Browse files
authored
add Github action workflow for release across Linux, Windows and macOS (#498)
add github release workflow for targets: macOS(64bit,ARM), Windows(64bit), Linux(64bit,ARM)
1 parent 6ebe5bc commit fdd9ab7

File tree

2 files changed

+137
-152
lines changed

2 files changed

+137
-152
lines changed

.github/workflows/github-release.yml

Lines changed: 0 additions & 152 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Release builds for Mac(64bit, Arm), Windows and Linux(64 bit, Arm)
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.[0-9]+.[0-9]+*
7+
paths-ignore:
8+
- "docs/**"
9+
- "helm/**"
10+
- "assets/**"
11+
- "**.md"
12+
13+
jobs:
14+
build-linux:
15+
name: Build for ${{matrix.target}}
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
target:
21+
- aarch64-unknown-linux-gnu # linux(arm)
22+
- x86_64-unknown-linux-gnu # linux(64 bit)
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: actions-rs/toolchain@v1
26+
with:
27+
toolchain: stable
28+
profile: minimal # minimal component installation (ie, no documentation)
29+
target: ${{matrix.target}}
30+
override: true
31+
32+
- uses: actions-rs/cargo@v1
33+
with:
34+
use-cross: true
35+
command: build
36+
args: --release --target ${{matrix.target}}
37+
38+
- name: Create Artifact
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: Parseable_${{ matrix.target }}
42+
path: target/${{ matrix.target }}/release/parseable
43+
44+
- name: Rename binary
45+
run: |
46+
mv target/${{ matrix.target }}/release/parseable Parseable_${{ matrix.target }}
47+
48+
- name: Publish Archive to Release Page
49+
uses: softprops/[email protected]
50+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
51+
with:
52+
draft: false
53+
files: Parseable_${{ matrix.target }}
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
57+
build-windows:
58+
runs-on: windows-latest
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v1
62+
63+
- name: Install latest rust toolchain
64+
uses: actions-rs/toolchain@v1
65+
with:
66+
toolchain: stable
67+
profile: minimal
68+
default: true
69+
override: true
70+
71+
- name: Build
72+
run: cargo build --all --release --target x86_64-pc-windows-msvc
73+
74+
- name: Create artifact for Windows
75+
uses: actions/upload-artifact@v2
76+
with:
77+
name: Parseable_x86_64-pc-windows-msvc
78+
path: target/x86_64-pc-windows-msvc/release/PARSEABLE.exe
79+
80+
- name: Rename binary
81+
run: |
82+
mv target/x86_64-pc-windows-msvc/release/PARSEABLE.exe Parseable_x86_64-pc-windows-msvc.exe
83+
84+
- name: Publish Archive to Release Page
85+
uses: softprops/[email protected]
86+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
87+
with:
88+
draft: false
89+
files: Parseable_x86_64-pc-windows-msvc.exe
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
93+
build-mac:
94+
runs-on: macos-latest
95+
strategy:
96+
matrix:
97+
target:
98+
- aarch64-apple-darwin
99+
- x86_64-apple-darwin
100+
101+
steps:
102+
- name: Checkout
103+
uses: actions/checkout@v1
104+
105+
- name: Install latest rust toolchain
106+
uses: actions-rs/toolchain@v1
107+
with:
108+
toolchain: stable
109+
profile: minimal
110+
target: ${{ matrix.target }}
111+
default: true
112+
override: true
113+
114+
- name: Build
115+
run: |
116+
cargo build --release --target ${{ matrix.target }}
117+
strip target/${{ matrix.target }}/release/Parseable
118+
119+
- name: Create artifact
120+
uses: actions/upload-artifact@v2
121+
with:
122+
name: Parseable_${{ matrix.target }}
123+
path: |
124+
target/${{ matrix.target }}/release/Parseable
125+
126+
- name: Rename binary
127+
run: |
128+
mv target/${{ matrix.target }}/release/Parseable Parseable_${{ matrix.target }}
129+
130+
- name: Publish Archive to Release Page
131+
uses: softprops/[email protected]
132+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
133+
with:
134+
draft: false
135+
files: Parseable_${{ matrix.target }}
136+
env:
137+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)