-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (59 loc) · 1.67 KB
/
draft-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
name: draft-release
on:
push:
tags: '*'
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
exec_name: rw3d_cli
- os: windows-latest
target: x86_64-pc-windows-msvc
exec_name: rw3d_cli.exe
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build with Cargo
uses: actions-rs/cargo@v1
with:
command: build
args: --package rw3d_cli --release --target ${{ matrix.target }}
- name: Zip the executable
uses: papeloto/action-zip@v1
with:
files: "target/${{ matrix.target }}/release/${{ matrix.exec_name }}"
dest: "rw3d_cli-${{ github.ref_name }}-${{ matrix.target }}.zip"
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target }}
path: "*.zip"
if-no-files-found: error
publish:
runs-on: ubuntu-latest
needs: build
if: success()
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Prepare artifact list for release action
run: echo "ARTIFACTS=$(echo $(find . -iname "*.zip") | sed "s/ /,/g")" >> $GITHUB_ENV
- name: Create draft release on GitHub
uses: ncipollo/release-action@v1
with:
artifacts: "${{ env.ARTIFACTS }}"
draft: true
allowUpdates: true
generateReleaseNotes: true