blob: 926a6958c29938e5bd6ac91999502c73aa160bf8 (
plain)
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
|
name: Publish
on:
push:
tags:
- 'v*'
jobs:
publish:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
artifact_name: target/x86_64-unknown-linux-musl/release/miniserve
release_name: linux-x86_64
target: x86_64-unknown-linux-musl
- os: windows-latest
artifact_name: target/x86_64-pc-windows-msvc/release/miniserve.exe
release_name: windows-x86_64.exe
target: x86_64-pc-windows-msvc
- os: macos-latest
artifact_name: target/x86_64-apple-darwin/release/miniserve
release_name: macos-x86_64
target: x86_64-apple-darwin
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: ${{ matrix.target }}
- run: sudo apt install musl-tools
if: matrix.os == 'ubuntu-latest'
- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --target=${{ matrix.target }}
- name: Compress binaries
uses: svenstaro/upx-action@v2
with:
file: ${{ matrix.artifact_name }}
args: --lzma
- name: Get tag name
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
shell: bash
- name: Get CHANGELOG.md entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v1
with:
version: ${{ steps.tag.outputs.current_version }}
path: ./CHANGELOG.md
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.artifact_name }}
tag: ${{ github.ref }}
asset_name: miniserve-$tag-${{ matrix.release_name }}
body: ${{ steps.changelog_reader.outputs.log_entry }}
|