Skip to content

Commit dd85c1a

Browse files
Initial commit
0 parents  commit dd85c1a

25 files changed

+780
-0
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: RustForWeb
2+
open_collective: rustforweb

.github/renovate.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["github>RustForWeb/.github:renovate-config"]
4+
}

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
pull_request: {}
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
17+
env:
18+
RUSTFLAGS: '-Dwarnings'
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v5
23+
24+
- name: Set up Rust toolchain
25+
uses: actions-rust-lang/setup-rust-toolchain@v1
26+
with:
27+
components: clippy, rustfmt
28+
target: wasm32-unknown-unknown
29+
30+
- name: Install Cargo Binary Install
31+
uses: cargo-bins/cargo-binstall@main
32+
33+
- name: Install crates
34+
run: cargo binstall -y --force cargo-deny cargo-machete cargo-sort
35+
36+
- name: Lint
37+
run: cargo clippy --all-features --all-targets --locked
38+
39+
- name: Check dependencies
40+
run: cargo deny check
41+
42+
- name: Check unused dependencies
43+
run: cargo machete --with-metadata
44+
45+
- name: Check manifest formatting
46+
run: cargo sort --workspace --check
47+
48+
- name: Check formatting
49+
run: cargo fmt --all --check
50+
51+
test:
52+
name: Test
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v5
58+
59+
- name: Set up Rust toolchain
60+
uses: actions-rust-lang/setup-rust-toolchain@v1
61+
with:
62+
components: clippy, rustfmt
63+
target: wasm32-unknown-unknown
64+
65+
- name: Test
66+
run: cargo test --locked --release

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump:
7+
description: 'Bump version by semver keyword.'
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
release:
20+
name: Release
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Generate GitHub App token
25+
id: app-token
26+
uses: getsentry/action-github-app-token@v3
27+
with:
28+
app_id: ${{ secrets.APP_ID }}
29+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
30+
31+
- name: Checkout
32+
uses: actions/checkout@v5
33+
34+
- name: Set up Rust toolchain
35+
uses: actions-rust-lang/setup-rust-toolchain@v1
36+
with:
37+
target: wasm32-unknown-unknown
38+
39+
- name: Install Cargo Binary Install
40+
uses: cargo-bins/cargo-binstall@main
41+
42+
- name: Install crates
43+
run: cargo binstall --force -y cargo-workspaces toml-cli
44+
45+
- name: Bump version
46+
run: cargo workspaces version --all --no-git-commit --yes ${{ inputs.bump }}
47+
48+
- name: Extract version
49+
id: extract-version
50+
run: echo "VERSION=v$(toml get Cargo.toml workspace.package.version --raw)" >> "$GITHUB_OUTPUT"
51+
52+
- name: Add changes
53+
run: git add .
54+
55+
- name: Commit
56+
uses: dsanders11/github-app-commit-action@v1
57+
with:
58+
message: ${{ steps.extract-version.outputs.VERSION }}
59+
token: ${{ steps.app-token.outputs.token }}
60+
61+
- name: Reset and pull
62+
run: git reset --hard && git pull
63+
64+
- name: Tag
65+
uses: bruno-fs/repo-tagger@1.0.0
66+
with:
67+
tag: ${{ steps.extract-version.outputs.VERSION }}
68+
env:
69+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
70+
71+
- name: Release
72+
uses: softprops/action-gh-release@v2
73+
with:
74+
generate_release_notes: true
75+
make_latest: true
76+
tag_name: ${{ steps.extract-version.outputs.VERSION }}
77+
token: ${{ steps.app-token.outputs.token }}
78+
79+
- name: Publish
80+
run: cargo workspaces publish --publish-as-is --token "${{ secrets.CRATES_IO_TOKEN }}"

.github/workflows/website.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Website
2+
on:
3+
pull_request: {}
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: false
14+
15+
jobs:
16+
book-test:
17+
name: Test Book
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v5
22+
23+
- name: Set up Rust toolchain
24+
uses: actions-rust-lang/setup-rust-toolchain@v1
25+
with:
26+
target: wasm32-unknown-unknown
27+
28+
- name: Install Cargo Binary Install
29+
uses: cargo-bins/cargo-binstall@main
30+
31+
- name: Install mdBook
32+
run: cargo binstall --force -y mdbook mdbook-tabs
33+
34+
- name: Run tests
35+
run: mdbook test
36+
working-directory: book
37+
38+
book-build:
39+
name: Build Book
40+
needs: book-test
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- uses: actions/checkout@v5
45+
with:
46+
fetch-depth: 0
47+
48+
- name: Set up Rust toolchain
49+
uses: actions-rust-lang/setup-rust-toolchain@v1
50+
with:
51+
target: wasm32-unknown-unknown
52+
53+
- name: Install Cargo Binary Install
54+
uses: cargo-bins/cargo-binstall@main
55+
56+
- name: Install mdBook
57+
run: cargo binstall --force -y mdbook mdbook-tabs
58+
59+
- name: Install Node.js dependencies
60+
run: npm install
61+
62+
- name: Build Book
63+
run: mdbook build
64+
working-directory: book
65+
66+
- name: Upload artifact
67+
uses: actions/upload-artifact@v5
68+
with:
69+
name: book
70+
path: book/book
71+
retention-days: 1
72+
if-no-files-found: error
73+
74+
deploy:
75+
name: Deploy
76+
needs: book-build
77+
if: github.ref == 'refs/heads/main'
78+
runs-on: ubuntu-latest
79+
80+
permissions:
81+
contents: read
82+
pages: write
83+
id-token: write
84+
85+
steps:
86+
- uses: actions/checkout@v5
87+
with:
88+
fetch-depth: 0
89+
90+
- name: Download artifacts
91+
uses: actions/download-artifact@v6
92+
with:
93+
path: dist
94+
merge-multiple: true
95+
96+
- name: Setup Pages
97+
uses: actions/configure-pages@v5
98+
99+
- name: Upload artifact
100+
uses: actions/upload-pages-artifact@v4
101+
with:
102+
path: dist
103+
104+
- name: Deploy to GitHub Pages
105+
id: deployment
106+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)