Skip to content
Open
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4d588a8
add semver validator action
mfahampshire Jan 19, 2026
a4a59c2
update runner
mfahampshire Jan 19, 2026
20bc24c
Release 1.20.2
mfahampshire Jan 19, 2026
eb35e3e
update runner with sed for old version in CI
mfahampshire Jan 19, 2026
53a6ba9
Add no commit to publish for the moment
mfahampshire Jan 19, 2026
4462d6f
try switch to gh runner
mfahampshire Jan 20, 2026
eb1d952
switch runner back
mfahampshire Jan 20, 2026
49444c5
get rid of npx for the moment
mfahampshire Jan 20, 2026
a0bb294
tweak version command
mfahampshire Jan 20, 2026
3d3ef89
fix version bump command
mfahampshire Jan 20, 2026
6964d89
configure git bot
mfahampshire Jan 20, 2026
151514b
error check
mfahampshire Jan 20, 2026
0e84493
remove `--from-git`
mfahampshire Jan 20, 2026
986e194
make dryrun less opaque
mfahampshire Jan 20, 2026
a32548f
Reintroduce error check - keep logging dryrun in for debug (commented
mfahampshire Jan 20, 2026
40b5b1c
fix grep check
mfahampshire Jan 20, 2026
3ae1817
bring non-dry-run to parity
mfahampshire Jan 20, 2026
b033900
add node for npx semver check to action
mfahampshire Jan 20, 2026
80e7cdf
updated sed command
mfahampshire Jan 20, 2026
4175de5
revert erroneous version bump
mfahampshire Jan 20, 2026
293456e
added semver check to publish workflow
mfahampshire Jan 20, 2026
dd59779
allow from other branches
mfahampshire Jan 20, 2026
bf6e8de
Release 1.20.2
Jan 20, 2026
30e9bed
allow from other branches again
mfahampshire Jan 20, 2026
d12b129
publishing guide
mfahampshire Jan 20, 2026
065258f
Merge branch 'max/crates-publishing-tweaks' of github.com:nymtech/nym…
mfahampshire Jan 20, 2026
fcf2b26
Release 1.20.3
Jan 20, 2026
8126a0d
update publication runner
mfahampshire Jan 20, 2026
adaf5c3
Merge branch 'max/crates-publishing-tweaks' of github.com:nymtech/nym…
mfahampshire Jan 20, 2026
82d2687
remove --allow-branch ; no commit, doesn't need branch restrictions
mfahampshire Jan 20, 2026
5f04e39
remove another clashing flag
mfahampshire Jan 20, 2026
f5052b1
again
mfahampshire Jan 20, 2026
7f517d8
exclude build.rs from crate for crates.io
mfahampshire Jan 20, 2026
796c2df
various in process scripts to pick up deployment where it left off
mfahampshire Jan 21, 2026
3141104
rename workflows
mfahampshire Jan 21, 2026
0fe2a9f
Version bump fix from borked publish run
mfahampshire Jan 21, 2026
bce949e
temp push edit
mfahampshire Jan 21, 2026
0b9bc24
add publishing doc + updated publish-resume ci
mfahampshire Jan 21, 2026
3b7ff3f
move example from service-providers to sdk examples/ to remove circul…
mfahampshire Jan 21, 2026
dd4e60f
remove wildcard version import
mfahampshire Jan 21, 2026
46c738d
Workflows and documentation for publication
mfahampshire Jan 22, 2026
3a17e2f
add contracts/ patch + imports
mfahampshire Jan 22, 2026
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
79 changes: 79 additions & 0 deletions .github/workflows/ci-crates-publish-dry-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Publish to crates.io (dry run)

on:
workflow_dispatch:
inputs:
version:
description: "Version to publish (e.g. 1.21.0)"
required: true
type: string

env:
CI_BOT_AUTHOR: "Nym bot"
CI_BOT_EMAIL: "nym-bot@users.noreply.github.com"

jobs:
publish-dry-run:
runs-on: arc-linux-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6

- name: Configure git identity
run: |
git config --global user.name "${{ env.CI_BOT_AUTHOR }}"
git config --global user.email "${{ env.CI_BOT_EMAIL }}"

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Install cargo-workspaces
run: cargo install cargo-workspaces

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Validate version format
run: |
if ! npx semver "${{ inputs.version }}"; then
echo "Error: '${{ inputs.version }}' is not valid semver"
exit 1
fi

- name: Get current version
id: current_version
run: |
VERSION=$(grep -oP '^\s*version\s*=\s*"\K[0-9]+\.[0-9]+\.[0-9]+' Cargo.toml | head -1)
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Update workspace dependencies
run: |
sed -i '/path = /s/version = "${{ steps.current_version.outputs.version }}"/version = "${{ inputs.version }}"/g' Cargo.toml

- name: Bump versions (local only)
run: |
cargo workspaces version custom ${{ inputs.version }} \
--allow-branch ${{ github.ref_name }} \
--no-git-commit \

# Dry run may show cascading dependency errors because packages aren't
# actually uploaded - these are expected and ignored. We check for real
# errors like packaging failures, missing metadata, or invalid Cargo.toml.
- name: Publish (dry run)
run: |
output=$(cargo workspaces publish --dry-run --allow-dirty 2>&1) || true
echo "$output"

# Check for real errors (not cascading dependency errors)
# Cascading errors mention "crates.io index", real errors mention "Cargo.toml"
echo "$output" | grep -i "Cargo.toml" && exit 1 || true

# Show the list of packages published
- name: Show package versions
run: cargo workspaces list --long
59 changes: 59 additions & 0 deletions .github/workflows/ci-crates-publish-resume.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This is in case, for whatever reason, a publication run fails, and we need to restart halfway down the list, of unbumped/unpublished crates.
name: Resume crates.io publish

on:
workflow_dispatch:
inputs:
resume_after:
description: "Last successfully published crate (will start from the next one)"
required: true
type: string
publish_interval:
description: "Seconds to wait between publishes"
required: false
default: "600"
type: string

jobs:
publish:
runs-on: arc-linux-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Install cargo-workspaces
run: cargo install cargo-workspaces

# Get crates in publish order, skip up to and including resume_after
- name: Publish remaining crates
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
CRATES=$(cargo workspaces plan 2>/dev/null | sed -n '/^${{ inputs.resume_after }}$/,$p' | tail -n +2)

if [ -z "$CRATES" ]; then
echo "Error: No crates found after '${{ inputs.resume_after }}'"
echo "Check the crate name matches exactly from 'cargo workspaces plan'"
exit 1
fi

echo "Will publish the following crates:"
echo "$CRATES"
echo ""

echo "$CRATES" | while read crate; do
echo "Publishing $crate..."
cargo publish -p "$crate" --allow-dirty
echo "Waiting ${{ inputs.publish_interval }}s before next publish..."
sleep ${{ inputs.publish_interval }}
done

- name: Show package versions
run: cargo workspaces list --long
86 changes: 86 additions & 0 deletions .github/workflows/ci-crates-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Publish crates to crates.io

on:
workflow_dispatch:
inputs:
publish_interval:
description: "Seconds to wait between publishes (600 for first publish, 60 after)"
required: false
default: "600"
type: string
backup_author:
description: "Second team member added as owner of the crate"
required: false
default: "jstuczyn"
type: string

jobs:
publish:
runs-on: arc-linux-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Install cargo-workspaces
run: cargo install cargo-workspaces

# `--publish-as-is` skips version bumping since that's done in a separate CI job.
- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo workspaces publish \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given how long the process takes, if it's not too difficult it could be useful to send zulip notifications on failures

--publish-as-is \
--publish-interval ${{ inputs.publish_interval }}

- name: Show package versions
run: cargo workspaces list --long

- name: Add team as crate owners
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
TEAM="github:nymtech:core"
echo "Checking and adding $TEAM as owner to workspace crates..."

cargo workspaces list | while read crate; do
echo "Checking $crate..."

if cargo owner --list "$crate" 2>/dev/null | grep -q "$TEAM"; then
echo " $TEAM already owns $crate, skipping"
else
echo " Adding $TEAM as owner of $crate..."
cargo owner --add "$TEAM" "$crate"
sleep 2
fi
done

echo "Done!"

- name: Add secondary member as crate owner
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
TEAM_MEMBER="${{ inputs.backup_author }}"
echo "Checking and adding $TEAM_MEMBER as owner to workspace crates..."

cargo workspaces list | while read crate; do
echo "Checking $crate..."

if cargo owner --list "$crate" 2>/dev/null | grep -q "$TEAM_MEMBER"; then
echo " $TEAM_MEMBER already owns $crate, skipping"
else
echo " Adding $TEAM_MEMBER as owner of $crate..."
cargo owner --add "$TEAM_MEMBER" "$crate"
sleep 2
fi
done

echo "Done!"
74 changes: 74 additions & 0 deletions .github/workflows/ci-crates-version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Bump crate versions

on:
workflow_dispatch:
inputs:
version:
description: "Version to set (e.g. 1.21.0)"
required: true
type: string

env:
CI_BOT_AUTHOR: "Nym bot"
CI_BOT_EMAIL: "nym-bot@users.noreply.github.com"

jobs:
version-bump:
runs-on: arc-linux-latest
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v6

- name: Configure git identity
run: |
git config --global user.name "${{ env.CI_BOT_AUTHOR }}"
git config --global user.email "${{ env.CI_BOT_EMAIL }}"

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Install cargo-workspaces
run: cargo install cargo-workspaces

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Validate version format
run: |
if ! npx semver "${{ inputs.version }}"; then
echo "Error: '${{ inputs.version }}' is not valid semver"
exit 1
fi

- name: Get current version
id: current_version
run: |
VERSION=$(grep -oP '^\s*version\s*=\s*"\K[0-9]+\.[0-9]+\.[0-9]+' Cargo.toml | head -1)
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Update workspace dependencies
run: |
sed -i '/path = /s/version = "${{ steps.current_version.outputs.version }}"/version = "${{ inputs.version }}"/g' Cargo.toml

- name: Bump versions
run: |
cargo workspaces version custom ${{ inputs.version }} \
--no-git-commit \
--yes

- name: Commit and push version bump
run: |
git add -A
git commit -m "crates release: bump version to ${{ inputs.version }}"
git push

- name: Show package versions
run: cargo workspaces list --long
43 changes: 0 additions & 43 deletions .github/workflows/publish-crates-io-dry-run.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/publish-crates-io.yml

This file was deleted.

Loading
Loading