-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (74 loc) · 2.25 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
name: Build & Release
on:
push:
tags:
- "v*"
env:
BINARY: clever-roles
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Create Release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
publish:
name: publish ${{ matrix.name }}
needs:
- release
strategy:
fail-fast: true
matrix:
include:
- target: x86_64-pc-windows-gnu
suffix: windows-x86_64
archive: zip
- target: x86_64-unknown-linux-musl
suffix: linux-x86_64
archive: tar.xz
- target: x86_64-apple-darwin
suffix: darwin-x86_64
archive: tar.gz
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Compile ${{ matrix.suffix }}
id: compile
uses: rust-build/rust-build.action@v1.4.0
with:
RUSTTARGET: ${{ matrix.target }}
UPLOAD_MODE: none
TOOLCHAIN_VERSION: stable
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.BINARY }}-${{ matrix.suffix }}
path: |
${{ steps.compile.outputs.BUILT_ARCHIVE }}
${{ steps.compile.outputs.BUILT_CHECKSUM }}
Readme.md
LICENSE
ARCHIVE_TYPES: ${{ matrix.archive }}
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.BINARY }}-${{ matrix.suffix }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ${{steps.download.outputs.download-path}}/${{ env.BINARY }}-${{ matrix.suffix }}.${{ matrix.archive }}
asset_name: ${{ env.BINARY }}-${{ matrix.suffix }}.${{ matrix.archive }}
asset_content_type: application/octet-stream