Skip to content

Commit 3a7a08f

Browse files
committed
separate build and release workflows
1 parent 6ba36ae commit 3a7a08f

File tree

2 files changed

+36
-19
lines changed

2 files changed

+36
-19
lines changed

Diff for: .github/workflows/build.yaml

-19
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,3 @@ jobs:
1414
run: cargo build --verbose
1515
- name: Run tests
1616
run: cargo test --verbose
17-
pre-release-check:
18-
if: success() && startsWith(github.ref, 'refs/tags/')
19-
runs-on: ubuntu-latest
20-
needs: [build]
21-
steps:
22-
- uses: actions/checkout@v4
23-
- name: Publish Dry Run
24-
run: cargo publish --dry-run
25-
release:
26-
if: success() && startsWith(github.ref, 'refs/tags/')
27-
environment: crates.io
28-
runs-on: ubuntu-latest
29-
needs: [build, pre-release-check]
30-
env:
31-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
32-
steps:
33-
- uses: actions/checkout@v4
34-
- name: Publish
35-
run: cargo publish

Diff for: .github/workflows/release.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Build
17+
run: cargo build --verbose
18+
- name: Run tests
19+
run: cargo test --verbose
20+
pre-release-check:
21+
runs-on: ubuntu-latest
22+
needs: [build]
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Publish Dry Run
26+
run: cargo publish --dry-run
27+
release:
28+
environment: crates.io
29+
runs-on: ubuntu-latest
30+
needs: [build, pre-release-check]
31+
env:
32+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Publish
36+
run: cargo publish

0 commit comments

Comments
 (0)