Skip to content

Commit ede8b6e

Browse files
committed
build on push
1 parent 5704d2d commit ede8b6e

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

.github/workflows/crates.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,34 @@
11
on:
22
push:
3-
# Pattern matched against refs/tags
43
branch: ["master"]
54

65
name: Publish to crates.io
76

7+
env:
8+
CRATES_DEPLOY: false
9+
810
jobs:
9-
publish:
10-
name: Publish
11+
build_and_test:
12+
name: Build the client
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Install Nightly toolchain
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
profile: minimal
21+
toolchain: nightly
22+
override: true
23+
24+
- run: rustup toolchain list
25+
- uses: actions-rs/cargo@v1
26+
with:
27+
command: build
28+
args: --release --all-features
29+
30+
check_and_publish:
31+
name: Check semver and publish to crates.io
1132
runs-on: ubuntu-latest
1233
steps:
1334
- name: Checkout sources
@@ -20,6 +41,9 @@ jobs:
2041
toolchain: nightly
2142
override: true
2243

23-
- run: cargo publish -p tinydancer --token ${CRATES_TOKEN} --no-verify
44+
- name: Publish to crates.io
45+
if: "contains(${{ env.CRATES_DEPLOY }},'true')"
46+
run: cargo publish -p tinydancer --token ${CRATES_TOKEN} --no-verify
2447
env:
48+
CRATES_DEPLOY: ${{ secrets.CRATES_DEPLOY }}
2549
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}

0 commit comments

Comments
 (0)