-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (68 loc) · 2.5 KB
/
pre_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
on:
push:
branches:
- 'release*'
# Sequence of patterns matched against refs/tags
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Pre Release
jobs:
release:
name: Create Pre Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Extract branch name
id: extract_branch
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.extract_branch.outputs.branch }}
release_name: Release ${{ steps.extract_branch.outputs.branch }}
draft: true
prerelease: true
publish:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# This should work with only the `include`s but it currently doesn't because of this bug:
# https://github.community/t5/How-to-use-Git-and-GitHub/GitHub-Actions-Matrix-options-dont-work-as-documented/td-p/29558
os: [ubuntu-18.04, ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-18.04
artifact_name: canyon-cli
asset_name: canyon-cli-x86_64-unknown-linux-gnu
- os: ubuntu-latest
artifact_name: canyon-cli
asset_name: canyon-cli-x86_64-unknown-linux-gnu
- os: windows-latest
artifact_name: canyon-cli.exe
asset_name: canyon-cli-x86_64-pc-windows-msvc
- os: macos-latest
artifact_name: canyon-cli
asset_name: canyon-cli-x86_64-apple-darwin
steps:
- uses: hecrj/setup-rust-action@master
with:
rust-version: stable
- uses: actions/checkout@v1
- name: Extract branch name
id: extract_branch
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Build
run: cargo build --release
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.os }}-${{ matrix.asset_name }}
tag: ${{ steps.extract_branch.outputs.branch }}