Skip to content

Commit 773487c

Browse files
committed
feat: add release-plz, CI, and publish fabric-rs to crates.io
- Rename crate to fabric-rs ([lib] name = "fabric" for use statements) - Switch all workspace deps from git to crates.io versions - Add release-plz.toml and workflow for automated releases - Add test/lint CI (cargo fmt, clippy -D warnings) - Add commitlint for conventional commits - Trigger binding publish workflows on fabric-v* tags - Add cache-control headers to /addrs endpoint - Fix all clippy warnings across fabric and relay - Auto-initialize WASM in fabric-web (no manual init() needed)
1 parent e36bb6b commit 773487c

40 files changed

Lines changed: 1003 additions & 532 deletions

.commitlintrc.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
extends:
2+
- '@commitlint/config-conventional'
3+
4+
rules:
5+
header-max-length: [2, always, 100]
6+
type-enum:
7+
- 2
8+
- always
9+
- - build
10+
- chore
11+
- ci
12+
- docs
13+
- feat
14+
- fix
15+
- perf
16+
- refactor
17+
- revert
18+
- style
19+
- test

.github/workflows/commitlint.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Commitlint
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited, synchronize]
6+
7+
jobs:
8+
commitlint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- uses: wagoid/commitlint-github-action@v6
15+
with:
16+
configFile: .commitlintrc.yml

.github/workflows/publish-go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish Go
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- "fabric-v*"
77
workflow_dispatch:
88

99
permissions:

.github/workflows/publish-js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish JS packages
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- "fabric-v*"
77
workflow_dispatch:
88

99
jobs:
@@ -26,7 +26,7 @@ jobs:
2626
- name: Determine version
2727
id: version
2828
run: |
29-
VERSION="${GITHUB_REF_NAME#v}"
29+
VERSION="${GITHUB_REF_NAME#fabric-v}"
3030
if [[ ! "$GITHUB_REF" == refs/tags/* ]]; then
3131
VERSION="0.0.0-dev.$(date +%Y%m%d%H%M%S)"
3232
fi

.github/workflows/publish-kotlin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish Kotlin
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- "fabric-v*"
77
workflow_dispatch:
88

99
permissions:
@@ -21,7 +21,7 @@ jobs:
2121
- name: Determine version
2222
id: version
2323
run: |
24-
VERSION="${GITHUB_REF_NAME#v}"
24+
VERSION="${GITHUB_REF_NAME#fabric-v}"
2525
if [[ ! "$GITHUB_REF" == refs/tags/* ]]; then
2626
VERSION="0.0.0-dev.$(date +%Y%m%d%H%M%S)"
2727
fi

.github/workflows/publish-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish Python
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- "fabric-v*"
77
workflow_dispatch:
88

99
permissions:
@@ -25,7 +25,7 @@ jobs:
2525
- name: Determine version
2626
id: version
2727
run: |
28-
VERSION="${GITHUB_REF_NAME#v}"
28+
VERSION="${GITHUB_REF_NAME#fabric-v}"
2929
if [[ ! "$GITHUB_REF" == refs/tags/* ]]; then
3030
VERSION="0.0.0-dev.$(date +%Y%m%d%H%M%S)"
3131
fi

.github/workflows/publish-swift.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish Swift
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- "fabric-v*"
77
workflow_dispatch:
88

99
permissions:

.github/workflows/release-plz.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release-plz
2+
3+
permissions:
4+
pull-requests: write
5+
contents: write
6+
7+
on:
8+
push:
9+
branches: [main]
10+
11+
jobs:
12+
release-plz-pr:
13+
name: Release-plz PR
14+
runs-on: ubuntu-latest
15+
if: ${{ github.repository_owner == 'spacesprotocol' }}
16+
concurrency:
17+
group: release-plz-${{ github.ref }}
18+
cancel-in-progress: false
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- uses: dtolnay/rust-toolchain@stable
24+
- name: Run release-plz
25+
uses: release-plz/action@v0.5
26+
with:
27+
command: release-pr
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
31+
32+
release-plz-release:
33+
name: Release-plz publish
34+
runs-on: ubuntu-latest
35+
if: ${{ github.repository_owner == 'spacesprotocol' }}
36+
steps:
37+
- uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 0
40+
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
41+
- uses: dtolnay/rust-toolchain@stable
42+
- name: Run release-plz
43+
uses: release-plz/action@v0.5
44+
with:
45+
command: release
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
48+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Rust
20+
uses: dtolnay/rust-toolchain@stable
21+
22+
- uses: Swatinem/rust-cache@v2
23+
24+
- name: Build
25+
run: cargo build -p fabric-rs -p relay
26+
27+
- name: Run tests
28+
run: cargo test -p fabric-rs
29+
30+
lint:
31+
name: Lint
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: dtolnay/rust-toolchain@stable
36+
with:
37+
components: rustfmt, clippy
38+
- uses: Swatinem/rust-cache@v2
39+
- run: cargo fmt --all -- --check
40+
- run: cargo clippy -p fabric-rs -p relay --all-features -- -D warnings

0 commit comments

Comments
 (0)