diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 623c3151f..9bb00eb6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1232,3 +1232,24 @@ jobs: # - name: Print rows in the user table # if: always() # run: spacetime sql quickstart-chat "SELECT * FROM user" + + version_upgrade_check: + runs-on: spacetimedb-new-runner-2 + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) + # pnpm is required for regenerating the typescript bindings + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - uses: pnpm/action-setup@v4 + with: + run_install: true + - name: Verify that upgrade-version still works + run: cargo ci version-upgrade-check + - name: Show diff + run: git diff HEAD diff --git a/.github/workflows/upgrade-version-check.yml b/.github/workflows/upgrade-version-check.yml deleted file mode 100644 index be209c5c1..000000000 --- a/.github/workflows/upgrade-version-check.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Upgrade Version Check - -on: - pull_request: - types: [opened, synchronize] - merge_group: -permissions: read-all - -jobs: - version_upgrade_check: - runs-on: spacetimedb-new-runner-2 - steps: - - name: Checkout - uses: actions/checkout@v3 - - uses: dsherret/rust-toolchain-file@v1 - - name: Set default rust toolchain - run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - # pnpm is required for regenerating the typescript bindings - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - uses: pnpm/action-setup@v4 - with: - run_install: true - - name: Verify that upgrade-version still works - run: cargo bump-versions 123.456.789 --rust-and-cli --csharp --typescript --cpp --accept-snapshots - - name: Show diff - run: git diff HEAD - diff --git a/tools/ci/README.md b/tools/ci/README.md index dbe452243..3530ee24b 100644 --- a/tools/ci/README.md +++ b/tools/ci/README.md @@ -217,6 +217,17 @@ Usage: typescript-test - `--help`: Print help +### `version-upgrade-check` + +**Usage:** +```bash +Usage: version-upgrade-check +``` + +**Options:** + +- `--help`: Print help + ### `docs` **Usage:** diff --git a/tools/ci/src/main.rs b/tools/ci/src/main.rs index 3c31c3663..146651c10 100644 --- a/tools/ci/src/main.rs +++ b/tools/ci/src/main.rs @@ -276,6 +276,8 @@ enum CiCmd { PublishChecks, /// Runs TypeScript workspace tests and template build checks. TypescriptTest, + /// Verifies that the repository version upgrade tool still works. + VersionUpgradeCheck, /// Builds the docs site. Docs, } @@ -443,6 +445,21 @@ fn run_docs_build() -> Result<()> { Ok(()) } +fn run_version_upgrade_check() -> Result<()> { + cmd!( + "cargo", + "bump-versions", + "123.456.789", + "--rust-and-cli", + "--csharp", + "--typescript", + "--cpp", + "--accept-snapshots" + ) + .run()?; + Ok(()) +} + fn main() -> Result<()> { env_logger::init(); @@ -711,6 +728,10 @@ fn main() -> Result<()> { run_typescript_tests()?; } + Some(CiCmd::VersionUpgradeCheck) => { + run_version_upgrade_check()?; + } + Some(CiCmd::Docs) => { run_docs_build()?; }