-
Notifications
You must be signed in to change notification settings - Fork 32
65 lines (58 loc) · 1.9 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
name: publish-release
on:
push:
tags:
- "*.*.*"
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: Get version from tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/}
shell: bash
- uses: actions/checkout@v2
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.tag_name.outputs.current_version }}
- name: Release body
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.changelog_reader.outputs.changes }}
artifact:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: macos-latest
OS_NAME: macOS
TARGET: x86_64-apple-darwin
- os: ubuntu-latest
OS_NAME: linux
TARGET: x86_64-unknown-linux-musl
- os: windows-latest
OS_NAME: windows
TARGET: x86_64-pc-windows-gnu
EXTENSION: .exe
steps:
- name: Get version from tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/}
shell: bash
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.TARGET }}
- uses: Swatinem/rust-cache@v1
- run: cargo build --release --target ${{ matrix.TARGET }}
- run: cp target/${{ matrix.TARGET }}/release/rpg-cli${{ matrix.EXTENSION }} rpg-cli-${{ steps.tag_name.outputs.current_version }}-${{ matrix.OS_NAME }}${{ matrix.EXTENSION }}
- name: Release files
uses: softprops/action-gh-release@v1
with:
files: rpg-cli-${{ steps.tag_name.outputs.current_version }}-${{ matrix.OS_NAME }}${{ matrix.EXTENSION }}