-
-
Notifications
You must be signed in to change notification settings - Fork 2
119 lines (115 loc) · 3.18 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
on:
release:
types: [published]
name: Release
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
include:
- os: ubuntu-latest
target: x86_64-linux-gnu
- os: macos-latest
target: x86_64-darwin
- os: windows-latest
target: x86_64-windows-gnu
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: 'true'
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Cache
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.target }}
path: ./target
upload-binaries:
name: Upload Release Artifacts
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
target:
- x86_64-linux-gnu
- x86_64-darwin
- x86_64-windows-gnu
include:
- target: x86_64-linux-gnu
bin: felloe
- target: x86_64-darwin
bin: felloe
- target: x86_64-windows-gnu
bin: felloe.exe
steps:
- name: Checkout
uses: actions/checkout@v1
- uses: actions/download-artifact@v1
with:
name: ${{ matrix.target }}
- name: Tarball
uses: juankaram/[email protected]
with:
args: "tar -czvf felloe-${{ matrix.target }}.tar.gz \
-C ./${{ matrix.target }}/release/ \
${{ matrix.bin }} \
completions \
README.md \
LICENSE"
- name: Zip
working-directory: ./${{ matrix.target }}/release
run: "zip -r ../../felloe-${{ matrix.target }}.zip \
${{ matrix.bin }} \
completions \
README.md \
LICENSE"
- name: Upload Zip
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: felloe-${{ matrix.target }}.zip
asset_name: felloe-${{ matrix.target }}.zip
asset_content_type: application/zip
- name: Upload Tarball
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: felloe-${{ matrix.target }}.tar.gz
asset_name: felloe-${{ matrix.target }}.tar.gz
asset_content_type: application/x-gzip
publish-crate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: 'true'
- name: Login
uses: actions-rs/cargo@v1
with:
command: login
args: ${{ secrets.CRATES_API_KEY }}
- name: Publish
uses: actions-rs/cargo@v1
with:
command: publish