Skip to content

Commit b548694

Browse files
🌅
0 parents  commit b548694

File tree

17 files changed

+1417
-0
lines changed

17 files changed

+1417
-0
lines changed

‎.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
env:
10+
# The NAME makes it easier to copy/paste snippets from other CI configs
11+
NAME: tree-splicer
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Format
19+
run: cargo fmt && git diff --exit-code
20+
- name: Deps
21+
run: |
22+
rustup update
23+
rustup component add clippy
24+
- uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
25+
- name: Lint
26+
run: cargo clippy -- --deny warnings
27+
28+
static:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v3
32+
- name: Deps
33+
run: |
34+
sudo apt-get install -y musl-tools
35+
rustup target add x86_64-unknown-linux-musl
36+
- uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
37+
- run: |
38+
cargo build \
39+
--bin ${NAME}-rust \
40+
--locked \
41+
--release \
42+
--target=x86_64-unknown-linux-musl
43+
44+
test:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v3
48+
- uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
49+
- run: cargo test --locked --no-run
50+
- run: cargo test

‎.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- release*
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Deps
17+
run: |
18+
sudo apt-get install -y musl-tools
19+
rustup target add x86_64-unknown-linux-musl
20+
21+
- name: Build static executables
22+
run: |
23+
cargo build \
24+
--bin ${NAME}-rust \
25+
--locked \
26+
--release \
27+
--target=x86_64-unknown-linux-musl
28+
cp target/x86_64-unknown-linux-musl/release/tree-splicer-rust .
29+
30+
- uses: ncipollo/release-action@v1
31+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
32+
with:
33+
artifacts: "tree-splicer-rust"
34+
artifactErrorsFailBuild: true
35+
body: "See [CHANGELOG.md](https://github.com/langston-barrett/tree-splicer/blob/main/doc/CHANGELOG.md)."
36+
draft: true
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Publish to crates.io
40+
env:
41+
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
42+
# Only push on actual release tags
43+
PUSH: ${{ startsWith(github.ref, 'refs/tags/v') }}
44+
run: |
45+
for pkg in tree-splicer{,-rust}; do
46+
if [[ ${PUSH} == true ]]; then
47+
cargo publish --token ${CRATES_IO_TOKEN} -p "${pkg}"
48+
else
49+
cargo publish --dry-run --token ${CRATES_IO_TOKEN} -p "${pkg}"
50+
fi
51+
sleep 5
52+
done

‎.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
tree-splicer.out/

0 commit comments

Comments
 (0)