Skip to content

Commit a146141

Browse files
Copilotlarp0
andcommitted
Update GitHub Action to use CARGO_API_KEY and correct tag pattern
Co-authored-by: larp0 <[email protected]>
1 parent 1aca72d commit a146141

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

.github/workflows/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This repository includes automated GitHub Actions workflows for the Rust SDK loc
2626

2727
**Triggers:**
2828
- New GitHub releases
29-
- Tags matching pattern `rust-v*` (e.g., `rust-v0.1.0`, `rust-v1.2.0`)
29+
- Tags matching pattern `sdk/rust/v*` (e.g., `sdk/rust/v0.1.0`, `sdk/rust/v1.2.0`)
3030

3131
**What it does:**
3232
- Validates code quality (formatting, building, testing)
@@ -40,7 +40,7 @@ This repository includes automated GitHub Actions workflows for the Rust SDK loc
4040

4141
To enable automatic publishing, you need to configure:
4242

43-
1. **`CRATES_TOKEN`** - Your crates.io API token
43+
1. **`CARGO_API_KEY`** - Your crates.io API token
4444
- Go to [crates.io/me](https://crates.io/me)
4545
- Generate a new token with publish permissions
4646
- Add as repository secret in GitHub Settings → Secrets and variables → Actions
@@ -52,10 +52,10 @@ To enable automatic publishing, you need to configure:
5252
1. **For releases:**
5353
```bash
5454
# Create and push a new tag
55-
git tag rust-v0.1.1
56-
git push origin rust-v0.1.1
55+
git tag sdk/rust/v0.1.1
56+
git push origin sdk/rust/v0.1.1
5757

58-
# Or create a GitHub release with tag rust-v0.1.1
58+
# Or create a GitHub release with tag sdk/rust/v0.1.1
5959
```
6060

6161
2. **For GitHub releases:**
@@ -68,7 +68,7 @@ For development or testing:
6868

6969
```bash
7070
cd rust
71-
export CRATES_TOKEN=your_token_here
71+
export CARGO_API_KEY=your_token_here
7272
cargo publish
7373
```
7474

@@ -136,7 +136,7 @@ cargo package --allow-dirty
136136
- Ensure dependencies are properly feature-gated
137137

138138
3. **Publishing failures:**
139-
- Verify `CRATES_TOKEN` secret is configured
139+
- Verify `CARGO_API_KEY` secret is configured
140140
- Check that version in `Cargo.toml` hasn't been published before
141141
- Ensure all required metadata is present in `Cargo.toml`
142142

@@ -156,5 +156,5 @@ The SDK uses semantic versioning:
156156
When publishing:
157157
1. Update version in `rust/Cargo.toml`
158158
2. Update documentation if needed
159-
3. Create tag with format `rust-vX.Y.Z`
159+
3. Create tag with format `sdk/rust/vX.Y.Z`
160160
4. Push tag to trigger publishing workflow

.github/workflows/publish-rust-sdk.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [published]
66
push:
77
tags:
8-
- 'rust-v*' # Triggers on tags like rust-v0.1.0, rust-v1.0.0, etc.
8+
- 'sdk/rust/v*' # Triggers on tags like sdk/rust/v0.1.0, sdk/rust/v1.0.0, etc.
99

1010
env:
1111
CARGO_TERM_COLOR: always
@@ -63,6 +63,6 @@ jobs:
6363
run: cargo package
6464

6565
- name: Publish to crates.io
66-
run: cargo publish --token ${{ secrets.CRATES_TOKEN }}
66+
run: cargo publish --token ${{ secrets.CARGO_API_KEY }}
6767
env:
68-
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}
68+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_KEY }}

rust/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ This project includes automated GitHub Actions workflows for publishing to crate
237237

238238
The SDK is automatically published to crates.io when:
239239
- A new release is created on GitHub
240-
- A tag matching the pattern `rust-v*` is pushed (e.g., `rust-v0.1.0`, `rust-v1.2.0`)
240+
- A tag matching the pattern `sdk/rust/v*` is pushed (e.g., `sdk/rust/v0.1.0`, `sdk/rust/v1.2.0`)
241241

242242
### Required Setup
243243

@@ -249,7 +249,7 @@ To enable automatic publishing, repository maintainers need to:
249249

250250
2. **Add the token as a GitHub secret**:
251251
- Go to repository Settings → Secrets and variables → Actions
252-
- Create a new secret named `CRATES_TOKEN`
252+
- Create a new secret named `CARGO_API_KEY`
253253
- Paste the crates.io API token as the value
254254

255255
### Manual Publishing
@@ -266,7 +266,7 @@ cargo test --all-features
266266
# Build and package
267267
cargo package
268268

269-
# Publish to crates.io (requires CRATES_TOKEN environment variable)
269+
# Publish to crates.io (requires CARGO_API_KEY environment variable)
270270
cargo publish
271271
```
272272

0 commit comments

Comments
 (0)