Skip to content

Commit

Permalink
Verify crates are publish-able on CI (#2036)
Browse files Browse the repository at this point in the history
This commit updates our CI to verify that all crates are publish-able at
all times on every commit. During the 0.19.0 release we found another
case where the crates as they live in this repository weren't
publish-able, so the hope is that this no longer comes up again!

The script added in this commit also takes the time/liberty to remove
the existing bump/publish scripts and instead replace them with one Rust
script originally sourced from wasm-bindgen. The intention of this
script is that it has three modes:

* `./publish bump` - bumps version numbers which are sent as a PR to get
  reviewed (probably with a changelog as well)

* `./publish verify` - run on CI on every commit, builds every crate we
  publish as if it's being published to crates.io, notably without raw
  access to other crates in the repository.

* `./publish publish` - publishes all crates to crates.io, passing the
  `--no-verify` flag to make this a much speedier process than it is
  today.
  • Loading branch information
alexcrichton committed Jul 17, 2020
1 parent a7cedf3 commit 978070c
Show file tree
Hide file tree
Showing 10 changed files with 355 additions and 186 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Expand Up @@ -558,3 +558,19 @@ jobs:
- run: |
cargo install --root ${{ runner.tool_cache }}/cargo-audit --version ${{ env.CARGO_AUDIT_VERSION }} cargo-audit
cargo audit
verify-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: rustup update stable && rustup default stable
- run: |
cd ${{ runner.tool_cache }}
curl -L https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz | tar xzf -
echo "::add-path::`pwd`/sccache-0.2.13-x86_64-unknown-linux-musl"
echo ::set-env name=RUSTC_WRAPPER::sccache
- run: |
rustc scripts/publish.rs
./publish verify
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -16,3 +16,6 @@ tags
target
.z3-trace
foo
.cargo
publish
vendor
1 change: 1 addition & 0 deletions crates/wiggle/test-helpers/Cargo.toml
Expand Up @@ -9,6 +9,7 @@ categories = ["wasm"]
keywords = ["webassembly", "wasm"]
repository = "https://github.com/bytecodealliance/wasmtime"
include = ["src/**/*", "LICENSE"]
publish = false

[dependencies]
proptest = "0.9"
Expand Down
2 changes: 1 addition & 1 deletion crates/wiggle/wasmtime/macro/Cargo.toml
Expand Up @@ -18,7 +18,7 @@ test = false
witx = { path = "../../../wasi-common/WASI/tools/witx", version = "0.8.5" }
wiggle-generate = { path = "../../generate", version = "0.19.0" }
quote = "1.0"
syn = { version = "1.0", features = ["full"] }
syn = { version = "1.0", features = ["full", "extra-traits"] }
proc-macro2 = "1.0"

[badges]
Expand Down
16 changes: 11 additions & 5 deletions docs/contributing-release-process.md
Expand Up @@ -11,17 +11,23 @@ whimsical currently, or on request from others) then the following steps need to
be executed to make the release:

1. `git pull` - make sure you've got the latest changes
1. Update the version numbers in `Cargo.toml` for all crates
* Edit `scripts/bump-wasmtime-version.sh`, notable the `version` variable
* Run the script
* Commit the changes
1. Run `rustc scripts/publish.rs`
1. Run `./publish bump`
* Review and commit the changes
* Note that this bumps all cranelift/wasmtime versions as a major version bump
at this time. See the `bump_version` function in `publish.rs` to tweak this.
1. Make sure `RELEASES.md` is up-to-date, and fill it out if it doesn't have an
entry yet for the current release.
1. Send this version update as a PR to the `wasmtime` repository, wait for a merge
1. After merging, tag the merge as `vA.B.C`
1. Push the tag to the repository
* This will trigger the release CI which will create all release artifacts and
publish them to GitHub releases.
1. Run `scripts/publish-wasmtime.sh` to publish all crates to crates.io
1. Run `./publish publish`
* This will fail on some crates, but that's expected.
* Keep running this script until all crates are published. Note that crates.io
won't let you publish something twice so rerunning is only for crates which
need the index to be udpated and if it hasn't yet. It's recommended to wait
a bit between runs of the script.

And that's it, then you've done a Wasmtime release.
31 changes: 0 additions & 31 deletions scripts/bump-cranelift-version.sh

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/bump-wasmtime-version.sh

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/publish-cranelift.sh

This file was deleted.

57 changes: 0 additions & 57 deletions scripts/publish-wasmtime.sh

This file was deleted.

0 comments on commit 978070c

Please sign in to comment.