-
-
Notifications
You must be signed in to change notification settings - Fork 33
66 lines (61 loc) · 1.59 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
name: Release
on:
push:
tags:
- v[0-9]+.*
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
RUST_BACKTRACE: 1
defaults:
run:
shell: bash
jobs:
create-release:
if: github.repository_owner == 'taiki-e'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: stable
- run: cargo package
- uses: taiki-e/create-gh-release-action@v1
with:
changelog: CHANGELOG.md
title: $version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
upload-assets:
name: ${{ matrix.target }}
if: github.repository_owner == 'taiki-e'
needs:
- create-release
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: x86_64-unknown-linux-musl
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v2
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: stable
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: cargo-hack
target: ${{ matrix.target }}
tar: all
zip: windows
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_PROFILE_RELEASE_LTO: true