crate-updates #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: crate-updates | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 0' # Runs on main by default every Sunday | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| bump-crate-versions: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'verus-lang/verus' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Update crate versions, if needed | |
| run: | | |
| cargo run --manifest-path source/tools/bump_crate_versions/Cargo.toml update | |
| - name: Commit and push version updates | |
| run: | | |
| git config --global user.name 'Version Bumper Bot' | |
| git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
| if ! git diff-index --quiet HEAD; then | |
| git commit -am "Update crate version numbers" | |
| git push | |
| else | |
| echo "No version updates needed" | |
| fi | |
| - name: Publish updated crates to crates.io | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| run: | | |
| cargo run --manifest-path source/tools/bump_crate_versions/Cargo.toml publish | |
| - name: Update Cargo.lock, if needed | |
| run: | | |
| pushd source; cargo update verus_builtin verus_builtin_macros verus_prettyplease verus_state_machines_macros verus_syn; popd | |
| - name: Commit and push updated lock file | |
| run: | | |
| git config --global user.name 'Version Bumper Bot' | |
| git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
| if ! git diff-index --quiet HEAD; then | |
| git commit -am "Update Cargo.lock" | |
| git push | |
| else | |
| echo "No Cargo.lock update needed" | |
| fi | |