Skip to content

Commit fa088c0

Browse files
authored
split ci/cd (#45)
Change-Id: I4af17afcdec166d645a522457962c3098a420bef
1 parent 8d0589d commit fa088c0

File tree

2 files changed

+44
-28
lines changed

2 files changed

+44
-28
lines changed

.github/workflows/release.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CD
2+
3+
on:
4+
push:
5+
tags: [ '*' ]
6+
env:
7+
RUST_BACKTRACE: 1
8+
jobs:
9+
Release:
10+
name: Cargo Publish
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
# This has a matcher for test panics, so we use it even though elsewhere
15+
# we use actions-rs/toolchain.
16+
- uses: hecrj/setup-rust-action@v1
17+
with:
18+
rust-version: stable${{ matrix.host }}
19+
targets: ${{ matrix.target }}
20+
components: 'rustfmt, clippy'
21+
22+
# cargo publish
23+
- uses: wangfenjin/publish-crates@main
24+
name: cargo publish
25+
with:
26+
path: './'
27+
args: --no-verify --allow-dirty --all-features
28+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
29+
ignore-published: true
30+
31+
# create release
32+
- name: "Build Changelog"
33+
id: build_changelog
34+
uses: mikepenz/release-changelog-builder-action@v1
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Create Release
38+
uses: actions/create-release@v1
39+
with:
40+
tag_name: ${{ github.ref }}
41+
release_name: ${{ github.ref }}
42+
body: ${{steps.build_changelog.outputs.changelog}}
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/rust.yaml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: CI
33
on:
44
push:
55
branches: [ main ]
6-
tags: [ '*' ]
76
pull_request:
87
branches: [ main ]
98
env:
@@ -84,37 +83,10 @@ jobs:
8483
RUST_BACKTRACE: "0"
8584
run: cargo -Z build-std test --features 'bundled' --features 'modern-full' --target x86_64-unknown-linux-gnu
8685

87-
# cargo publish
8886
- uses: wangfenjin/publish-crates@main
8987
name: cargo publish --dry-run
90-
if: startsWith(github.ref, 'refs/tags/') != true
9188
with:
9289
path: './'
9390
args: --allow-dirty --all-features
9491
dry-run: true
9592
ignore-published: true
96-
- uses: wangfenjin/publish-crates@main
97-
name: cargo publish
98-
if: startsWith(github.ref, 'refs/tags/')
99-
with:
100-
path: './'
101-
args: --no-verify --allow-dirty --all-features
102-
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
103-
ignore-published: true
104-
105-
# create release
106-
- name: "Build Changelog"
107-
id: build_changelog
108-
if: startsWith(github.ref, 'refs/tags/')
109-
uses: mikepenz/release-changelog-builder-action@v1
110-
env:
111-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112-
- name: Create Release
113-
if: startsWith(github.ref, 'refs/tags/')
114-
uses: actions/create-release@v1
115-
with:
116-
tag_name: ${{ github.ref }}
117-
release_name: ${{ github.ref }}
118-
body: ${{steps.build_changelog.outputs.changelog}}
119-
env:
120-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)