-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (38 loc) · 1019 Bytes
/
publish.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
name: Test and Publish
on:
push:
branches:
- "master"
- "branch*"
pull_request:
branches:
- "*"
jobs:
publish:
runs-on: ubuntu-latest
name: 'publish'
environment: cargo
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check fmt
run: cargo fmt --check
- name: Cache
uses: Swatinem/rust-cache@v1
with:
key: ${{ runner.os }}-build-v0.3.5
- name: Show cargo info
run: cargo version --verbose
- name: Install publish-action
if: steps.cache-publish-action.outputs.cache-hit != 'true'
run: |
cargo install publish-action --version=0.3.5
- name: Run Test
run: |
cargo test --doc
- name: Run publish-action of oss
run: publish-action --dir="/" --tag-prefix="v"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}