2525 with :
2626 fetch-depth : 0
2727 - name : Setup Node.js
28- uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
28+ uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
2929 with :
3030 node-version : ' 24.14.1'
3131 cache : ' yarn'
@@ -106,7 +106,9 @@ jobs:
106106 with :
107107 python-version : ' 3.14.3'
108108 cache : ' pip'
109- - run : yarn copy:lua:python
109+ - name : Copy Lua scripts for Python
110+ if : ${{ contains(env.commitmsg, '[python]') || contains(env.commitmsg, '(python)') }}
111+ run : yarn copy:lua:python
110112 - name : Install Python dependencies
111113 run : |
112114 python -m pip install --upgrade pip
@@ -158,6 +160,7 @@ jobs:
158160
159161 # Add and commit changes (only add files that exist)
160162 git add pyproject.toml || true
163+ git add bullmq/__init__.py || true
161164 git add ../docs/gitbook/python/changelog.md || true
162165
163166 # Check if there are actually changes to commit after adding
@@ -174,6 +177,7 @@ jobs:
174177
175178 This PR contains:
176179 - Updated pyproject.toml
180+ - Updated __init__.py
177181 - Updated changelog
178182 - Updated API documentation (if any)
179183
@@ -377,3 +381,90 @@ jobs:
377381 else
378382 echo "No changes detected after semantic-release"
379383 fi
384+
385+ # Rust Release
386+ - name : Setup Rust
387+ uses : dtolnay/rust-toolchain@stable
388+ - name : Copy Lua scripts for Rust
389+ if : ${{ contains(env.commitmsg, '[rust]') || contains(env.commitmsg, '(rust)') }}
390+ run : yarn copy:lua:rust
391+ - name : Cache Cargo registry
392+ uses : actions/cache@v4
393+ with :
394+ path : |
395+ ~/.cargo/registry
396+ ~/.cargo/git
397+ rust/target
398+ key : ${{ runner.os }}-cargo-release-${{ hashFiles('rust/Cargo.lock') }}
399+ restore-keys : |
400+ ${{ runner.os }}-cargo-release-
401+ - name : Install dependencies Rust
402+ if : ${{ contains(env.commitmsg, '[rust]') || contains(env.commitmsg, '(rust)') }}
403+ working-directory : rust
404+ run : yarn install --frozen-lockfile --non-interactive
405+ - name : Release Rust
406+ id : semantic_release_rust
407+ if : ${{ contains(env.commitmsg, '[rust]') || contains(env.commitmsg, '(rust)') }}
408+ working-directory : rust
409+ env :
410+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
411+ CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
412+ run : npx semantic-release
413+ - name : Create PR with Rust release changes
414+ if : ${{ success() && steps.semantic_release_rust.outcome == 'success' }}
415+ env :
416+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
417+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
418+ working-directory : rust
419+ run : |
420+ # Check if there are any changes to commit
421+ if [[ -n $(git status --porcelain) ]]; then
422+ # Get the version from Cargo.toml
423+ VERSION=$(grep -m 1 '^version' Cargo.toml | cut -d'"' -f2)
424+ BRANCH_NAME="release/vrs${VERSION}"
425+
426+ echo "Creating PR for release version: vrs${VERSION}"
427+
428+ # Create and switch to new branch
429+ git checkout -b $BRANCH_NAME
430+
431+ # Configure git
432+ git config --local user.email "action@github.com"
433+ git config --local user.name "GitHub Action"
434+
435+ # Add and commit changes
436+ git add Cargo.toml || true
437+ git add Cargo.lock || true
438+ git add CHANGELOG.md || true
439+
440+ # Check if there are actually changes to commit after adding
441+ if [[ -n $(git diff --cached --name-only) ]]; then
442+ git commit -m "chore(release): vrs${VERSION}"
443+
444+ # Push the branch
445+ git push origin $BRANCH_NAME
446+
447+ # Create PR using GitHub CLI
448+ gh pr create \
449+ --title "chore(release): vrs${VERSION}" \
450+ --body "Automated release PR for version vrs${VERSION}
451+
452+ This PR contains:
453+ - Updated rust/Cargo.toml version
454+ - Updated rust/Cargo.lock
455+ - Updated rust/CHANGELOG.md
456+
457+ Please review and merge to complete the release process." \
458+ --head $BRANCH_NAME \
459+ --base master
460+
461+ echo "Created PR for release vrs${VERSION}"
462+ git checkout origin/master
463+ else
464+ echo "No changes to commit after staging files"
465+ git checkout origin/master
466+ git branch -D $BRANCH_NAME
467+ fi
468+ else
469+ echo "No changes detected after semantic-release"
470+ fi
0 commit comments