-
Notifications
You must be signed in to change notification settings - Fork 29
72 lines (67 loc) · 2.08 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
67
68
69
70
71
72
name: release
on:
push:
tags:
- v*
jobs:
github_build:
name: GitHub Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install rustfmt
run: rustup component add rustfmt
- name: Install clippy
run: rustup component add clippy
- name: Check format
run: cargo fmt --all -- --check
- name: Lint (all features)
run: cargo clippy --all-targets --all-features -- -D clippy::all
- name: Lint (no_std)
run: cargo clippy --all-targets --no-default-features --features alloc -- -D clippy::all
- name: Lint (no_alloc)
run: cargo clippy --all-targets --no-default-features -- -D clippy::all
- name: Test (default)
run: cargo test --verbose
- name: Test (no_std)
run: cargo test --no-default-features --features alloc --verbose
- name: Test (no_alloc)
run: cargo test --no-default-features --verbose
github_release:
name: Create GitHub Release
needs: github_build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Generate release notes
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest
git-chglog -c .chglog/config.yml $(git describe --tags) > RELEASE.md
- name: Create GitHub release ${{ matrix.target }}
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Publish to Crates.io
cargo_publish:
name: Publish Cargo Package
needs: github_build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: cargo login $CRATES_IO_TOKEN
- run: cargo publish
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}