Skip to content

Commit 5902631

Browse files
committed
add github workflows
1 parent c5ea55d commit 5902631

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Build
19+
run: cargo build --verbose
20+
- name: Run tests
21+
run: cargo test --verbose
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: BuildAndPublish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
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+
21+
publish:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Login into crates.io
27+
run: cargo login ${{ secrets.CRATES_IO }}
28+
- name: Build binaries in "release" mode
29+
run: cargo build -r
30+
- name: "Publish to crates.io"
31+
run: cargo publish # publishes your crate as a library that can be added as a dependency

0 commit comments

Comments
 (0)