-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (60 loc) · 1.86 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
name: release
on:
push:
tags:
- v*
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: true
prerelease: false
generate_release_notes: true
artefact:
strategy:
matrix:
include:
- name: Linux x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-musl
suffix: ''
runs-on: ${{ matrix.os }}
name: Create artefact for ${{ matrix.name }}
needs: [release]
steps:
- uses: actions/checkout@v3
- name: Stable Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: ${{ matrix.target }}
toolchain: stable
- name: Install musl-tools
run: sudo apt update -y && sudo apt install musl-tools -y
if: matrix.os == 'ubuntu-latest'
- name: Build
run: cargo build --target ${{ matrix.target }} --release
- name: Move binary
run: mv target/${{ matrix.target }}/release/bsud${{ matrix.suffix }} bsud-${{ github.ref_name }}-${{ matrix.target }}${{ matrix.suffix }}
- name: Upload Artefact to release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: true
prerelease: false
files: bsud-${{ github.ref_name }}-${{ matrix.target }}${{ matrix.suffix }}