-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (74 loc) · 2.4 KB
/
dev-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
name: Beta release
on:
push:
branches:
- main
jobs:
release:
name: Beta (dev) release for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, windows-latest, ubuntu-latest]
rust: [stable]
include:
- os: macOS-latest
archive: tar.gz
os_name: macOS
target: x86_64-apple-darwin
content_type: application/gzip
- os: windows-latest
archive: zip
os_name: windows
target: x86_64-pc-windows-msvc
content_type: application/zip
- os: ubuntu-latest
archive: tar.gz
os_name: linux
target: x86_64-unknown-linux-gnu
content_type: application/gzip
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Unit tests
uses: actions-rs/cargo@v1
with:
command: test
args: --release
- name: Build executable
uses: actions-rs/cargo@v1
with:
command: build
toolchain: ${{ matrix.rust }}
args: --release --target ${{ matrix.target }}
- name: Get current time
uses: 1466587594/get-current-time@v1
id: current-time
with:
format: YYYY-MM-DD
utcOffset: "-05:00"
- name: Set output filename
id: output-name
run: echo "::set-output name=filename::rag-${{ matrix.os_name }}-beta-${{ steps.current-time.outputs.formattedTime }}-${{ github.sha }}-${{ matrix.target }}.${{ matrix.archive }}"
- name: Build ZIP
id: build_zip
if: matrix.archive == 'zip'
run: |
cp target/${{ matrix.target }}/release/random-art-generator.exe rag.exe
7z a ${{ steps.output-name.outputs.filename }} rag.exe
- name: Build TAR
id: build_tar
if: matrix.archive == 'tar.gz'
run: |
cp target/${{ matrix.target }}/release/random-art-generator rag
tar czvf ${{ steps.output-name.outputs.filename }} rag
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: ${{ steps.output-name.outputs.filename }}
path: ${{ steps.output-name.outputs.filename }}