-
Notifications
You must be signed in to change notification settings - Fork 38
77 lines (68 loc) · 1.96 KB
/
cli.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
name: Build and release CLI
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
target:
- aarch64-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- aarch64-apple-darwin
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
include:
- target: aarch64-unknown-linux-gnu
os: ubuntu-20.04
ext: ''
- target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
ext: ''
- target: aarch64-apple-darwin
os: macos-11.0
ext: ''
- target: x86_64-apple-darwin
os: macos-11.0
ext: ''
- target: x86_64-pc-windows-msvc
os: windows-2019
ext: '.exe'
steps:
- uses: actions/checkout@v1
- name: Get version
id: version
shell: bash
run: echo ::set-output name=VERSION::"$([[ "$GITHUB_REF" == refs/tags/v* ]] && echo ${GITHUB_REF#refs/tags/v} || echo '0.0.0')"
- name: Get file name
id: file
shell: bash
run: echo ::set-output name=FILE::${{ steps.version.outputs.VERSION }}-${{ matrix.target }}${{ matrix.ext }}
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build CLI
working-directory: ./minhtml
run: cargo build --release -vvv
- name: Upload
uses: actions/upload-artifact@v4
with:
name: minhtml-${{ steps.file.outputs.FILE }}
path: ./target/release/minhtml${{ matrix.EXT }}
release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
path: '.'
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: '*'