Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
extends:
- '@commitlint/config-conventional'

rules:
header-max-length: [2, always, 100]
type-enum:
- 2
- always
- - build
- chore
- ci
- docs
- feat
- fix
- perf
- refactor
- revert
- style
- test
16 changes: 16 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Commitlint

on:
pull_request:
types: [opened, reopened, edited, synchronize]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v6
with:
configFile: .commitlintrc.yml
2 changes: 1 addition & 1 deletion .github/workflows/publish-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Go
on:
push:
tags:
- "v*"
- "fabric-v*"
workflow_dispatch:

permissions:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish JS packages
on:
push:
tags:
- "v*"
- "fabric-v*"
workflow_dispatch:

jobs:
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Determine version
id: version
run: |
VERSION="${GITHUB_REF_NAME#v}"
VERSION="${GITHUB_REF_NAME#fabric-v}"
if [[ ! "$GITHUB_REF" == refs/tags/* ]]; then
VERSION="0.0.0-dev.$(date +%Y%m%d%H%M%S)"
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Kotlin
on:
push:
tags:
- "v*"
- "fabric-v*"
workflow_dispatch:

permissions:
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Determine version
id: version
run: |
VERSION="${GITHUB_REF_NAME#v}"
VERSION="${GITHUB_REF_NAME#fabric-v}"
if [[ ! "$GITHUB_REF" == refs/tags/* ]]; then
VERSION="0.0.0-dev.$(date +%Y%m%d%H%M%S)"
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Python
on:
push:
tags:
- "v*"
- "fabric-v*"
workflow_dispatch:

permissions:
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Determine version
id: version
run: |
VERSION="${GITHUB_REF_NAME#v}"
VERSION="${GITHUB_REF_NAME#fabric-v}"
if [[ ! "$GITHUB_REF" == refs/tags/* ]]; then
VERSION="0.0.0-dev.$(date +%Y%m%d%H%M%S)"
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Swift
on:
push:
tags:
- "v*"
- "fabric-v*"
workflow_dispatch:

permissions:
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release-plz

permissions:
pull-requests: write
contents: write

on:
push:
branches: [main]

jobs:
release-plz-pr:
name: Release-plz PR
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'spacesprotocol' }}
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: release-plz/action@v0.5
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

release-plz-release:
name: Release-plz publish
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'spacesprotocol' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: release-plz/action@v0.5
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
25 changes: 23 additions & 2 deletions .github/workflows/snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Extract code snippets

on:
push:
paths:
- "fabric/examples/**"
tags:
- "fabric-v*"
workflow_dispatch:

permissions:
Expand All @@ -17,8 +17,29 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Determine versions
id: version
run: |
if [[ "$GITHUB_REF" == refs/tags/fabric-v* ]]; then
echo "version=${GITHUB_REF_NAME#fabric-v}" >> "$GITHUB_OUTPUT"
else
echo "version=latest" >> "$GITHUB_OUTPUT"
fi
# Pull libveritas version from what we actually depend on
LV_VERSION=$(grep 'libveritas-jvm' fabric/kotlin/build.gradle.kts | head -1 | sed 's/.*:\([0-9][^"]*\).*/\1/')
echo "lv_version=$LV_VERSION" >> "$GITHUB_OUTPUT"

- name: Extract snippets
run: |
VERSION="${{ steps.version.outputs.version }}"
LV_VERSION="${{ steps.version.outputs.lv_version }}"

# Replace version placeholders in example files
find fabric/examples -type f \( -name "*.rs" -o -name "*.mjs" -o -name "*.go" -o -name "*.py" -o -name "*.kt" -o -name "*.swift" \) \
-exec sed -i "s/{{VERSION}}/$VERSION/g" {} + && \
find fabric/examples -type f \( -name "*.rs" -o -name "*.mjs" -o -name "*.go" -o -name "*.py" -o -name "*.kt" -o -name "*.swift" \) \
-exec sed -i "s/{{LV_VERSION}}/$LV_VERSION/g" {} +

cd fabric/examples
mkdir -p /tmp/snippets

Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Build
run: cargo build -p fabric-rs -p relay

- name: Run tests
run: cargo test -p fabric-rs

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
- run: cargo clippy -p fabric-rs -p relay --all-features -- -D warnings
Loading
Loading