From 19e479e43f81e377880276b8ec7860284d6c4cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 24 Jul 2024 10:59:32 +0900 Subject: [PATCH] chore: Update `cargo-mono` (#9323) --- .github/workflows/bench.yml | 6 ++-- .github/workflows/publish-npm-package.yml | 9 +++--- .github/workflows/publish.yml | 35 +++++++---------------- MAINTENANCE.md | 20 +------------ scripts/cargo/bump.sh | 22 -------------- scripts/publish.sh | 3 +- tools/swc-releaser/src/main.rs | 2 +- 7 files changed, 19 insertions(+), 78 deletions(-) delete mode 100755 scripts/cargo/bump.sh diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index e1edcb9d1745..93f22f95922e 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -94,11 +94,9 @@ jobs: - uses: ./.github/actions/setup-node - name: Install cargo-codspeed - uses: baptiste0928/cargo-install@v2.2.0 + uses: taiki-e/install-action@v2 with: - crate: cargo-codspeed - version: "2.6.0" - locked: true + tool: cargo-codspeed@2.6.0 - name: Build the benchmark target(s) run: cargo codspeed build --workspace --exclude swc_plugin_runner diff --git a/.github/workflows/publish-npm-package.yml b/.github/workflows/publish-npm-package.yml index a13e95c81189..13ec5224d7c0 100644 --- a/.github/workflows/publish-npm-package.yml +++ b/.github/workflows/publish-npm-package.yml @@ -69,16 +69,15 @@ jobs: - uses: ./.github/actions/setup-node - - uses: taiki-e/install-action@v2 + - name: Install git-cliff + uses: taiki-e/install-action@v2 with: tool: git-cliff@1.3.1 - name: Install cargo-edit - uses: baptiste0928/cargo-install@v2.2.0 + uses: taiki-e/install-action@v2 with: - crate: cargo-edit - version: "0.12.2" - locked: true + tool: cargo-edit@0.12.2 - name: "Setup jq" uses: dcarbone/install-jq-action@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 96a7cca299df..f76a2ded58c8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -51,17 +51,14 @@ jobs: profile: minimal - name: Install cargo-edit - uses: baptiste0928/cargo-install@v2.2.0 + uses: taiki-e/install-action@v2 with: - crate: cargo-edit - version: "0.12.2" - locked: true + tool: cargo-edit@0.12.2 - - name: Install cargo-mono - uses: baptiste0928/cargo-install@v2.2.0 + - name: Install cargo-edit + uses: taiki-e/install-action@v2 with: - crate: cargo-mono - version: "0.3.7" + tool: cargo-mono@0.4.1 - run: cargo bump @@ -88,17 +85,14 @@ jobs: profile: minimal - name: Install cargo-edit - uses: baptiste0928/cargo-install@v2.2.0 + uses: taiki-e/install-action@v2 with: - crate: cargo-edit - version: "0.12.2" - locked: true + tool: cargo-edit@0.12.2 - - name: Install cargo-mono - uses: baptiste0928/cargo-install@v2.2.0 + - name: Install cargo-edit + uses: taiki-e/install-action@v2 with: - crate: cargo-mono - version: "0.3.7" + tool: cargo-mono@0.4.1 - name: Update constant of swc_core run: npx ts-node .github/bot/src/cargo/update-constants.ts @@ -110,15 +104,6 @@ jobs: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} run: | cargo mono publish --no-verify - cargo mono publish --no-verify - cargo mono publish --no-verify - cargo mono publish --no-verify - cargo mono publish --no-verify - cargo mono publish --no-verify - cargo mono publish --no-verify - cargo mono publish --no-verify - cargo mono publish --no-verify - cargo mono publish --no-verify determine-nightly-version: name: "Determine nightly version" diff --git a/MAINTENANCE.md b/MAINTENANCE.md index ccd7ee3ed9de..7e0dad7c9499 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -4,25 +4,7 @@ This document describes a way to manage/publish the swc repositories. These task ## swc-project/swc -This is the main repository. To help rust-side users, swc publishes changed crates everytime a PR is merged. The publish action is done by `@swc-bot`. - -To control the bot, we use a review comment ending with yaml. The yaml should start with `swc-bump` and should be the last in the comment. An example of such comments is - -``` -Content about the PR - ---- - -swc-bump: - - swc_atoms - - swc_ecma_ast --breaking - -``` - -and this comment should be written by `@kdy1` at the moment. You can change this to allow more people by fixing [the bot script](https://github.com/swc-project/swc/blob/e46a192cb6b3281408d688b7bbf65c225ef6780e/scripts/bot/src/cargo/comment-parser.ts#L6). -Once PR is merged, the bot script will automatically publish crates and rebase another PR with auto-merged enabled. - -If you want to publish crates manually, you can do `cargo mono publish --no-verify` after installing `cargo-mono`. +You can use `@changeset` bot to mark a crate as modified (by a PR). After the PR is merged, you can run `cargo mono publish --no-verify` to publish all crates. ## swc-project/plugins diff --git a/scripts/cargo/bump.sh b/scripts/cargo/bump.sh deleted file mode 100755 index 0fc59ece3e53..000000000000 --- a/scripts/cargo/bump.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -set -eu - -git pull || true - -yarn changelog -cargo mono bump -i -# (cd ./bindings && cargo mono bump swc_cli) -# Ensure that Cargo.lock is up-to-date -cargo metadata --format-version 1 > /dev/null -# (cd ./bindings && cargo metadata --format-version 1 > /dev/null) - -# Ensure that dependencies are all verified -# ./scripts/crev/verify.sh - -git add -A -git commit -m 'chore: Publish crates' -git push --no-verify - -# Publish -cargo mono publish --no-verify -(cd ./bindings && cargo mono publish --no-verify) diff --git a/scripts/publish.sh b/scripts/publish.sh index 202579fb212a..c86424db704d 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -36,5 +36,4 @@ git commit -m 'chore: Update changelog' || true # Publish packages git push git@github.com:swc-project/swc.git --no-verify -git push git@github.com:swc-project/swc.git --no-verify --tags -# (cd ./bindings && cargo mono publish --no-verify) \ No newline at end of file +git push git@github.com:swc-project/swc.git --no-verify --tags \ No newline at end of file diff --git a/tools/swc-releaser/src/main.rs b/tools/swc-releaser/src/main.rs index e494296a8f9f..1170207e85ab 100644 --- a/tools/swc-releaser/src/main.rs +++ b/tools/swc-releaser/src/main.rs @@ -95,7 +95,7 @@ fn bump_crate(pkg_name: &str, change_type: Option<&ChangeType>, dry_run: bool) - return Ok(()); } - cmd.status().context("failed to run cargo mono bump")?; + cmd.status().context("failed to bump version")?; Ok(()) }