626d013547
* switch from yarn to pnpm * Remove full-nym-wasm (#6796) * Remove nym-browser-extension (#6798) * Remove nym-browser-extension * remove unused from makefile * Remove Node tester (#6800) * Remove dom-utils (#6801) * gh-actions: remove pnpm version * nuke dist and pkg * add missing dependency * set node version to 24 and pnpm version to 11 * upgrade lock file from pnpm version 9 to 11 * pnpm add approved builds * yarn -> pnpm * upgrade jest version * yarn -> pnpm * Remove unused cfg; clippy! * pnpm: when dev mode is on, unfreeze the lock file * pnpm approve more scripts * pnpm syntax error * add `pnpm i` * disable eslint temporarily while switching to biome in later PR --------- Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com> Co-authored-by: mfahampshire <maxhampshire@pm.me>
104 lines
3.2 KiB
YAML
104 lines
3.2 KiB
YAML
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
|
|
env:
|
|
RUSTUP_PERMIT_COPY_RENAME: 1
|
|
permissions:
|
|
contents: write
|
|
pull-requests: 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: 24
|
|
|
|
- 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: |
|
|
# Match any semver version on lines with `path = `, not just the current workspace version.
|
|
# This catches entries whose version has drifted (e.g. nym-sqlx-pool-guard at 1.2.0).
|
|
sed -i '/path = /s/version = "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*"/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: |
|
|
set -euo pipefail
|
|
BASE_BRANCH="${GITHUB_REF_NAME}"
|
|
PR_BRANCH="ci/crates-version-bump-${{ inputs.version }}-${GITHUB_RUN_ID}"
|
|
|
|
git checkout -b "$PR_BRANCH"
|
|
git add -A
|
|
git commit -m "crates release: bump version to ${{ inputs.version }}"
|
|
git push -u origin "$PR_BRANCH"
|
|
|
|
cat > /tmp/crates-version-bump-pr-body.md <<'EOF'
|
|
This PR was created by CI because direct pushes to the release branch are blocked by branch protection rules.
|
|
|
|
## Summary
|
|
- Bump workspace crate versions to the requested release version.
|
|
- Update workspace dependency versions accordingly.
|
|
|
|
## Notes
|
|
- Merge this PR to proceed with crates.io publishing.
|
|
EOF
|
|
|
|
gh pr create \
|
|
--base "$BASE_BRANCH" \
|
|
--head "$PR_BRANCH" \
|
|
--title "crates release: bump version to ${{ inputs.version }}" \
|
|
--body-file /tmp/crates-version-bump-pr-body.md
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Show package versions
|
|
run: cargo workspaces list --long
|