Skip to content

Commit

Permalink
Prepare a 2.0.1 release of Wasmtime (#5136)
Browse files Browse the repository at this point in the history
* Fix push tag workflow (#5082)

This commit fixes the `push-tag.yml` workflow to work with the new
`Cargo.toml` manifest since workspace inheritance was added. This
additionally fixes some warnings coming up on CI about our usage of
deprecated features on github actions.

* Reduce warnings on CI from GitHub Actions (#5083)

* Upgrade our github actions to "node16"

Each github actions run has a lot of warnings about using node12 so this
upgrades our repository to using node16. I'm hoping no other changes are
needed and I suspect other actions we're using are on node12 and will
need further updates, but this should help pin down what's remaining.

* Update `actions/checkout` workflow to `v3`

* Update to `actions/cache@v3`

* Update to `actions/upload-artifact@v3`

* Drop usage of `actions-rs/toolchain`

* Update to `actions/setup-python@v4`

* Update mdbook version

* Add `package-lock.json` for `github-release` action (#5091)

A local github action we have has been broken for about a month now
meaning that the `dev` tag isn't getting updated or getting new
releases. This appears to be due to the publication of new versions of
these dependencies which are running into issues using one another. I
think I've figured out versions that work and have added a
`package-lock.json` to ensure we keep using the same versions.

* More fixes for publish action (#5110)

Looks like #5091 wasn't enough and some of the APIs needed updating with
changes made in the meantime. I've updated the action here and
additionally made a separate change where the release isn't continually
created and deleted but instead left alone and only the tag is updated.
This should work for the `dev` release and avoids deleting/recreating on
each PR, sending out notifications for new releases.

* Add missing `Win32_Foundation` feature

This is necessary for the `wasmtime-runtime` crate to compile on Windows.

* Add a note for the 2.0.1 release

* Remove rayon dependency of cranelift-isle (#5101)

Using rayon adds a lot of dependencies to Cranelift. The total
unparallelized time the code that uses rayon takes is less than half a
second and it runs at compile time, so there is pretty much no benefit
to parallelizing it.

* Add a note about rayon removal

Co-authored-by: Christopher Serr <[email protected]>
Co-authored-by: bjorn3 <[email protected]>
  • Loading branch information
3 people authored Oct 26, 2022
1 parent ff8c568 commit 2ebb8a5
Show file tree
Hide file tree
Showing 17 changed files with 653 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/actions/binary-compatible-builds/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Set up a CentOS 6 container to build releases in'
description: 'Set up a CentOS 6 container to build releases in'

runs:
using: node12
using: node16
main: 'main.js'
inputs:
name:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/github-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ inputs:
description: ''
required: true
runs:
using: 'node12'
using: 'node16'
main: 'main.js'
42 changes: 25 additions & 17 deletions .github/actions/github-release/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function runOnce() {
core.info(`name: ${name}`);
core.info(`token: ${token}`);

const octokit = new github.GitHub(token);
const octokit = github.getOctokit(token);

// For the `dev` release we may need to update the tag to point to the new
// commit on this branch. All other names should already have tags associated
Expand All @@ -43,20 +43,10 @@ async function runOnce() {

if (tag === null || tag.data.object.sha !== sha) {
core.info(`updating existing tag or creating new one`);
// Delete the previous release for this tag, if any
try {
core.info(`fetching release for ${name}`);
const release = await octokit.repos.getReleaseByTag({ owner, repo, tag: name });
core.info(`deleting release ${release.data.id}`);
await octokit.repos.deleteRelease({ owner, repo, release_id: release.data.id });
} catch (e) {
// ignore, there may not have been a release
console.log("ERROR: ", JSON.stringify(e, null, 2));
}

try {
core.info(`updating dev tag`);
await octokit.git.updateRef({
await octokit.rest.git.updateRef({
owner,
repo,
ref: 'tags/dev',
Expand All @@ -80,6 +70,13 @@ async function runOnce() {
// tag by this point.
}
}

console.log("double-checking tag is correct");
tag = await octokit.request("GET /repos/:owner/:repo/git/refs/tags/:name", { owner, repo, name });
if (tag.data.object.sha !== sha) {
console.log("tag: ", JSON.stringify(tag.data, null, 2));
throw new Error("tag didn't work");
}
} else {
core.info(`existing tag works`);
}
Expand All @@ -91,12 +88,12 @@ async function runOnce() {
let release = null;
try {
core.info(`fetching release`);
release = await octokit.repos.getReleaseByTag({ owner, repo, tag: name });
release = await octokit.rest.repos.getReleaseByTag({ owner, repo, tag: name });
} catch (e) {
console.log("ERROR: ", JSON.stringify(e, null, 2));
core.info(`creating a release`);
try {
release = await octokit.repos.createRelease({
release = await octokit.rest.repos.createRelease({
owner,
repo,
tag_name: name,
Expand All @@ -105,19 +102,30 @@ async function runOnce() {
} catch(e) {
console.log("ERROR: ", JSON.stringify(e, null, 2));
core.info(`fetching one more time`);
release = await octokit.repos.getReleaseByTag({ owner, repo, tag: name });
release = await octokit.rest.repos.getReleaseByTag({ owner, repo, tag: name });
}
}
console.log("found release: ", JSON.stringify(release.data, null, 2));

// Upload all the relevant assets for this release as just general blobs.
for (const file of glob.sync(files)) {
const size = fs.statSync(file).size;
const name = path.basename(file);
for (const asset of release.data.assets) {
if (asset.name !== name)
continue;
console.log(`deleting prior asset ${asset.id}`);
await octokit.rest.repos.deleteReleaseAsset({
owner,
repo,
asset_id: asset.id,
});
}
core.info(`upload ${file}`);
await octokit.repos.uploadReleaseAsset({
await octokit.rest.repos.uploadReleaseAsset({
data: fs.createReadStream(file),
headers: { 'content-length': size, 'content-type': 'application/octet-stream' },
name: path.basename(file),
name,
url: release.data.upload_url,
});
}
Expand Down
Loading

0 comments on commit 2ebb8a5

Please sign in to comment.