-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (74 loc) · 2.1 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Release
on:
push:
branches: [ "main" ]
tags: 'v*'
paths-ignore:
- 'doc/**'
- '.github/**'
workflow_dispatch:
jobs:
build_test_and_bundle:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-20.04, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: setup rust stable
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: unit tests
run: cargo test --all --release
- name: bundle
shell: bash
run: |
mkdir Pulse
cp target/release/pulse Pulse/pulse-${{ matrix.os }}
cp LICENSE Pulse/
- name: upload bundle
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}
path: Pulse
release:
needs: [build_test_and_bundle]
if: github.ref_type == 'tag'
runs-on: ubuntu-22.04
steps:
- name: get linux build
uses: actions/download-artifact@v3
with:
name: ubuntu-20.04
- name: get windows build
uses: actions/download-artifact@v3
with:
name: windows-latest
- name: get macos build
uses: actions/download-artifact@v3
with:
name: macos-latest
- name: pack
run: |
mkdir linux windows macos
ls
mv pulse-ubuntu-20.04 pulse
chmod +x pulse
tar cvpfz linux-x86_64.tar.gz pulse LICENSE
mv pulse-windows-latest.exe pulse.exe
chmod +x pulse.exe
zip windows.zip pulse.exe LICENSE
mv pulse-macos-latest pulse
chmod +x pulse
tar cvpfz macOS.tar.gz pulse LICENSE
# https://github.com/softprops/action-gh-release
- name: release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: true
name: "release-${{ github.ref_name }}"
tag_name: ${{ github.ref }}
files: |
pulse-linux-x86_64.tar.gz
pulse-windows.zip
pulse-macOS.tar.gz