forked from bytebeamio/rumqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.4 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
name: Releaser
on:
push:
tags:
- 'rumqttd-*'
jobs:
build-release:
name: Build release for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: [linux-musl, linux-gnu]
include:
- build: linux-musl
os: ubuntu-latest
target: x86_64-unknown-linux-musl
- build: linux-gnu
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
target: ${{ matrix.target }}
- name: Use Cross
shell: bash
run: |
cargo install cross --git https://github.com/cross-rs/cross
echo "CARGO=cross" >> $GITHUB_ENV
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
- name: Build release binary
run: cross build --verbose --release ${{ env.TARGET_FLAGS }} -p rumqttd
- name: rename
# this assumes git tag is in format rumqttd-x.x.x
run: mv ${{ env.TARGET_DIR }}/release/rumqttd ${{ github.ref_name }}-${{ matrix.build }}
- name: Upload release archive
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: rumqttd*