Skip to content

Commit

Permalink
Automate more of the release process (#440)
Browse files Browse the repository at this point in the history
This commit updates the release process of `wasi-sdk` to remove most
of the manual interaction and steps done. Instead now draft releases are
automatically created for tags made. This means that there's only two
steps necessary: (1) pushing a tag and (2) hitting publish on the
generated release. This commit also removes a number of the CI scripts
previously used to manage releases.
  • Loading branch information
alexcrichton authored Jul 13, 2024
1 parent 778a02b commit 297b6d0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 300 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: CI

on:
create:
tags:
push:
tags:
- 'wasi-sdk-*'
branches:
- main

pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -200,3 +201,9 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Publish a draft release
if: startsWith(github.ref, 'refs/tags')
run: gh release create --draft --prerelease --generate-notes ${{ github.ref_name }} ./dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 5 additions & 45 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Release Process

> **Note**: These instructions are out-of-date given the latest refactoring of
> the build system and should get updated before the next release.
To publish a new version of `wasi-sdk` as a GitHub release:

1. Tag a commit with an annotated tag. Note that this must be an annotated tag,
Expand All @@ -17,49 +14,12 @@ To publish a new version of `wasi-sdk` as a GitHub release:
git push origin $TAG
```

2. Find a successful workflow that CI has run for the tag. That successful
workflow run will have build artifacts that need to be attached to the
release. One could search around in the GitHub [actions], but the following
script will list completed workflows for a tag (get a token [here][tokens]):

```shell script
ci/get-workflows-for-tag.sh $TAG $GITHUB_TOKEN
```

[actions]: https://github.com/WebAssembly/wasi-sdk/actions
[tokens]: https://github.com/settings/tokens

3. Check that the workflow built the artifacts for the given tag and that the
workflow completed successfully:

```shell script
ci/is-workflow-valid.sh $TAG $WORKFLOW_RUN_ID $GITHUB_TOKEN
```

4. Download and unzip the workflow artifacts. Note that artifacts with `+m` or
`.m` suffixes indicate that the Git tree was modified. Expect some duplicates
since some of the same artifacts are built on multiple CI runners (e.g.,
Windows, MacOS, Linux). The following script does all of this automatically:

```shell script
ci/download-workflow-artifacts.sh $WORKFLOW_RUN_ID $GITHUB_TOKEN
```

5. Draft a new release. This could be done [manually][releases] but the
following script simplifies the uploading of all the files and auto-generates
the release description:

```shell script
ci/draft-release.sh $TAG $ARTIFACTS_DIR $GITHUB_TOKEN
```

[releases]: https://github.com/WebAssembly/wasi-sdk/releases

6. Publish the release; the previous step only creates a draft. Follow the link
in the previous step or navigate to the GitHub [releases] to review the
description, commit, tag, and assets before clicking "Publish."
2. Wait for the CI build of the tag to finish. This will automatically publish
a draft pre-release to [GitHub Releases](https://github.com/WebAssembly/wasi-sdk/releases).
Release notes are auto-generated and should be reviewed for accuracy. Once
everything looks good manually publish the release through the GitHub UI.

7. Remember to tag the wasi-libc repository with the new `$TAG` version.
3. Remember to tag the wasi-libc repository with the new `$TAG` version.

```shell script
git submodule status -- src/wasi-libc # grab $WASI_LIBC_COMMIT from the output
Expand Down
81 changes: 0 additions & 81 deletions ci/download-workflow-artifacts.sh

This file was deleted.

71 changes: 0 additions & 71 deletions ci/draft-release.sh

This file was deleted.

43 changes: 0 additions & 43 deletions ci/get-workflows-for-tag.sh

This file was deleted.

58 changes: 0 additions & 58 deletions ci/is-workflow-valid.sh

This file was deleted.

0 comments on commit 297b6d0

Please sign in to comment.