Skip to content

Commit

Permalink
chore: Update cargo-mono (#9323)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 authored Jul 24, 2024
1 parent 831500e commit 19e479e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 78 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/publish-npm-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 10 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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"
Expand Down
20 changes: 1 addition & 19 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 0 additions & 22 deletions scripts/cargo/bump.sh

This file was deleted.

3 changes: 1 addition & 2 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
git push git@github.com:swc-project/swc.git --no-verify --tags
2 changes: 1 addition & 1 deletion tools/swc-releaser/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

0 comments on commit 19e479e

Please sign in to comment.