Skip to content

Commit d9219ec

Browse files
authored
Merge branch 'main' into feat/actor-ref-upgrade-fail-gracefully
2 parents ee34b23 + 06f5999 commit d9219ec

File tree

29 files changed

+2133
-1133
lines changed

29 files changed

+2133
-1133
lines changed

.github/workflows/checks.yml

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,68 @@
11
name: ✅ Checks
22
on:
3-
push:
4-
branches: [ "main" ]
5-
pull_request:
6-
branches: [ "main" ]
3+
# No long run pushes on main since it will be called by the release workflow
4+
# push:
5+
# branches: [ "main" ]
6+
pull_request:
7+
branches: ["main"]
8+
workflow_call:
79

810
env:
9-
CARGO_TERM_COLOR: always
10-
RUSTFLAGS: "-C target-cpu=native"
11-
CARGO_INCREMENTAL: 0
12-
RUST_BACKTRACE: 1
11+
CARGO_TERM_COLOR: always
12+
RUSTFLAGS: "-C target-cpu=native"
13+
CARGO_INCREMENTAL: 0
14+
RUST_BACKTRACE: 1
1315

1416
jobs:
15-
build_and_test:
16-
runs-on: ubuntu-latest
17-
steps:
18-
- name: 📥 Checkout code
19-
uses: actions/checkout@v4
17+
build_and_test:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: 📥 Checkout code
21+
uses: actions/checkout@v4
2022

21-
- name: 🦀 Install Rust toolchain
22-
uses: dtolnay/rust-toolchain@nightly
23-
with:
24-
components: clippy, rustfmt
23+
- name: 🦀 Install Rust toolchain
24+
uses: dtolnay/rust-toolchain@nightly
25+
with:
26+
components: clippy, rustfmt
2527

26-
- name: 💾 Rust Cache
27-
uses: Swatinem/rust-cache@v2
28-
with:
29-
shared-key: "build-cache"
28+
- name: 💾 Rust Cache
29+
uses: Swatinem/rust-cache@v2
30+
with:
31+
shared-key: "build-cache"
3032

31-
- name: 🔨 Build
32-
run: cargo build --verbose
33+
- name: 🔨 Build
34+
run: cargo build --verbose
3335

34-
- name: Install latest nextest release
35-
uses: taiki-e/install-action@nextest
36+
- name: Install latest nextest release
37+
uses: taiki-e/install-action@nextest
3638

37-
- name: 🧪 Run tests
38-
uses: actions-rs/cargo@v1
39-
with:
40-
command: nextest
41-
args: run --nocapture --no-fail-fast
39+
- name: 🧪 Run tests
40+
uses: actions-rs/cargo@v1
41+
with:
42+
command: nextest
43+
args: run --nocapture --no-fail-fast
4244

43-
lint:
44-
runs-on: ubuntu-latest
45-
steps:
46-
- name: 📥 Checkout code
47-
uses: actions/checkout@v4
45+
lint:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: 📥 Checkout code
49+
uses: actions/checkout@v4
4850

49-
- name: 🦀 Install Rust toolchain
50-
uses: dtolnay/rust-toolchain@nightly
51-
with:
52-
components: clippy, rustfmt
51+
- name: 🦀 Install Rust toolchain
52+
uses: dtolnay/rust-toolchain@nightly
53+
with:
54+
components: clippy, rustfmt
5355

54-
- name: 💾 Rust Cache
55-
uses: Swatinem/rust-cache@v2
56-
with:
57-
shared-key: "lint-cache"
56+
- name: 💾 Rust Cache
57+
uses: Swatinem/rust-cache@v2
58+
with:
59+
shared-key: "lint-cache"
5860

59-
- name: 🔍 Run linter
60-
run: cargo clippy --all-targets --all-features -- -D warnings
61+
- name: 🔍 Run linter
62+
run: cargo clippy --all-targets --all-features -- -D warnings
6163

62-
- name: 💅 Run format checker
63-
run: cargo fmt --check
64-
65-
- name: 📖 Run doc linter
66-
run: cargo doc --no-deps --document-private-items
64+
- name: 💅 Run format checker
65+
run: cargo fmt --check
66+
67+
- name: 📖 Run doc linter
68+
run: cargo doc --no-deps --document-private-items

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Publish Prerelease
2+
3+
on:
4+
push:
5+
paths:
6+
# Only run if these files are changed
7+
- "**/Cargo.toml"
8+
- "**/*.yml"
9+
- "**/Cargo.lock"
10+
- "**/*.rs"
11+
branches:
12+
- main
13+
14+
jobs:
15+
checks:
16+
uses: ./.github/workflows/checks.yml
17+
18+
publish-crates-io:
19+
name: Publish prerelease to crates.io
20+
runs-on: ubuntu-latest
21+
needs: checks
22+
concurrency:
23+
group: prerelease-${{ github.ref }}
24+
cancel-in-progress: false
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Install Rust
29+
uses: dtolnay/rust-toolchain@nightly
30+
31+
- name: Install cargo-edit
32+
run: cargo install cargo-edit --locked
33+
34+
- name: Compute prerelease version
35+
id: version
36+
run: |
37+
# Get base version from Cargo.toml (0.0.0)
38+
BASE_VERSION=$(cargo metadata --format-version=1 --no-deps \
39+
| jq -r '.packages[] | select(.name=="libtortillas") | .version')
40+
41+
# Strip patch for next prerelease (0.0.1-alpha.<sha>)
42+
NEXT_VERSION=$(echo "$BASE_VERSION" | awk -F. \
43+
'{ printf "%d.%d.%d", $1, $2, $3+1 }')
44+
45+
PRERELEASE_VERSION="${NEXT_VERSION}-alpha.${GITHUB_SHA::7}"
46+
47+
echo "prerelease_version=$PRERELEASE_VERSION" >> $GITHUB_OUTPUT
48+
49+
- name: Set prerelease version
50+
run: |
51+
cargo set-version -p libtortillas ${{ steps.version.outputs.prerelease_version }}
52+
53+
- name: Verify package (pre-publish)
54+
run: cargo package -p libtortillas --allow-dirty
55+
56+
- name: Publish to crates.io
57+
env:
58+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
59+
run: cargo publish -p libtortillas --allow-dirty

CONTRIBUTING.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,4 @@ This log level should be for:
105105

106106
#### `error!`
107107
This log level should be for:
108-
- A critical error that the user should know about
109-
110-
---
111-
112-
✅ Now the **Workflow** section explicitly links to the **Pull Requests** section for merge requirements.
113-
114-
Would you like me to also add a **"Quick Reference Checklist"** at the bottom (like a contributor TL;DR) so new contributors can see the whole process at a glance?
108+
- A critical error that the user should know about

0 commit comments

Comments
 (0)