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
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish stable-structures to crates.io

on:
workflow_dispatch:
inputs:
dryRun:
description: "If true, runs cargo publish with --dry-run"
required: false
type: boolean

jobs:
publish-ic-stable-structures:
runs-on: ubuntu-latest

permissions:
id-token: write # Required for OIDC token exchange

steps:
- uses: actions/checkout@v5

- uses: rust-lang/crates-io-auth-action@v1
id: auth

- run: echo "Preparing to cargo publish ${{ github.ref_name }}."

- run: cargo publish -p ic-stable-structures ${{ inputs.dryRun == true && '--dry-run' || '' }}
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

- name: Post to a Slack channel
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
with:
method: chat.postMessage
token: ${{ secrets.SLACK_API_TOKEN }}
payload: |
channel: eng-dsm-alerts
text: "${{ inputs.dryRun == true && 'DRY RUN: ' || '' }}New `stable-structures` crate (version `${{ github.ref_name }}`) has been published to crates.io"
22 changes: 3 additions & 19 deletions RELEASE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,9 @@ Adding a `reclaim()` method to free unused memory without changing layout, only

### Publish to crates.io

1. Generate an API token:
- Log in to crates.io → **Account Settings** → **API Tokens** → generate a new token.
2. Authenticate:
```bash
cargo login
```
Enter the token when prompted.
3. Check out the repo at the release tag:
```bash
git checkout vX.Y.Z
```
4. Dry-run publish (mandatory):
```bash
cargo publish -p ic-stable-structures --dry-run
```
5. Publish:
```bash
cargo publish -p ic-stable-structures
```
1. On the repository main page, navigate to the `Actions` tab.
2. Click on the workflow to publish to crates.io
3. Click on `run workflow` and select the version tag created above for the workflow to run on.

### Verify

Expand Down