Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate more of the release process #440

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading