This repository has been archived by the owner on May 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Paul Pietkiewicz <[email protected]>
- Loading branch information
Showing
2 changed files
with
180 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
# Release Process | ||
|
||
|
||
## Prerequisites: | ||
- Prepare release notes | ||
|
||
|
||
## Weekly chores | ||
### Enarx dependency update | ||
- Update local code | ||
```bash | ||
git fetch --all | ||
git checkout origin/main | ||
``` | ||
- Checkout chore branch | ||
```bash | ||
git checkout -b chore/cargo-update | ||
``` | ||
- Run `cargo update` within all individual sub-crates | ||
```bash | ||
for d in internal/*/ ; do (cd "$d" && cargo update); done | ||
``` | ||
- Git commit sub-crate update | ||
```bash | ||
git commit -asS -m 'chore(deps): update internal crate dependencies' | ||
``` | ||
- Run cargo update on `enarx` | ||
```bash | ||
cargo update | ||
``` | ||
- Git commit sub-crate update | ||
```bash | ||
git commit -asS -m 'chore(deps): update Enarx dependencies' | ||
``` | ||
- Run build and tests | ||
```bash | ||
cargo clean | ||
cargo build | ||
cargo tests | ||
``` | ||
- Create PR | ||
```bash | ||
git push origin chore/cargo-update | ||
gh pr create --title "chore(deps): update Enarx dependencies" | ||
``` | ||
|
||
|
||
## Enarx Release | ||
|
||
### Update and release prerequiste crates | ||
> **NOTE: ** This may be an optional step dependant on whether there are relevant changes in the prerequisite crates (e.g. `xsave`, `sallyport`, etc.): | ||
- Determine expected version by reviewing output of `git log` | ||
- Set new version | ||
```bash | ||
export NEW_VERSION="<my fancy new version e.g. 0.2.2>" | ||
``` | ||
- Ensure all approved PRs are merged | ||
- Get latest updates and checkout branch | ||
```bash | ||
git fetch --all | ||
git checkout origin/main | ||
git checkout -b release/v${NEW_VERSION} | ||
``` | ||
- Update dependencies | ||
```bash | ||
cargo update | ||
``` | ||
- Determine if crate builds and if it works | ||
```bash | ||
cargo clean | ||
cargo build | ||
cargo test | ||
``` | ||
- Update version in `Cargo.toml` | ||
```bash | ||
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml | ||
cargo update -p $(grep name Cargo.toml | cut -d'"' -f2) | ||
``` | ||
- Run `cargo test` again | ||
```bash | ||
cargo clean | ||
cargo build | ||
cargo test | ||
``` | ||
- Commit change and push to repo | ||
```bash | ||
git commit -asS -m "chore(release): Release v${NEW_VERSION}" | ||
git push origin | ||
``` | ||
- Confirm that changes passed on CI | ||
- Create a git tag | ||
```bash | ||
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION} | ||
git push --tags origin v${NEW_VERSION} | ||
``` | ||
- Cargo publish | ||
```bash | ||
cargo publish | ||
``` | ||
|
||
### The Enarx release itself | ||
- Determine expected version by reviewing output of `git log` | ||
- Set new version | ||
```bash | ||
export NEW_VERSION="<my fancy new version e.g. 0.2.2>" | ||
``` | ||
- Get latest updates and checkout branch | ||
```bash | ||
git fetch --all | ||
git checkout origin/main | ||
git checkout -b release/v${NEW_VERSION} | ||
``` | ||
- Bump version inside sub-crate `internal/{shim-sev,shim-sgx,wasmdr}/Cargo.toml` files | ||
```bash | ||
for d in internal/*/ ; do ( cd "$d" | ||
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml | ||
cargo update -p $(basename ${d}) | ||
git mv Cargo.toml Cargo.tml ) | ||
done | ||
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml | ||
cargo update -p enarx | ||
``` | ||
- _POTENTIALLY OPTIONAL STEP: If there are any changes in the prerequisite crates (e.g. `xsave`, `sallyport`, etc) then it will be required to manually update the crates now_ | ||
```bash | ||
export UPDATED_PREREQUISTES=(xsave sallyport) | ||
for d in internal/*/ ; do ( cd "$d" | ||
for p in ${UPDATED_PREREQUISTES[@]]}; do | ||
cargo update -p ${p} | ||
done | ||
done | ||
for p in ${UPDATED_PREREQUISTES[@]]}; do cargo update -p ${p}; done | ||
``` | ||
- Run unit tests | ||
```bash | ||
cargo clean | ||
cargo build | ||
cargo test | ||
``` | ||
- Rename Cargo.toml to Cargo.tml in sub-crates to address `cargo` sub-crate limitation | ||
```bash | ||
for d in internal/*/ ; do ( cd "$d" | ||
git mv Cargo.toml Cargo.tml ) | ||
done | ||
- Check cargo manifest | ||
```bash | ||
cargo package --allow-dirty -l | ||
``` | ||
- Commit change and push to repo | ||
```bash | ||
git commit -asS -m "chore(release): Release v${NEW_VERSION}" | ||
git push origin release/${NEW_VERSION} | ||
``` | ||
- Create and push `git` tag | ||
```bash | ||
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION} | ||
git push --tags origin v${NEW_VERSION} | ||
``` | ||
- Package and publish Enarx crate | ||
```bash | ||
cargo publish -v | ||
``` | ||
- Restore Cargo.tml files to Cargo.toml files | ||
```bash | ||
for i in internal/*/Cargo.tml; do git mv $i ${i%.tml}.toml; done | ||
git commit -asS -m 'chore(release): put back Cargo.toml files' | ||
git push origin | ||
``` | ||
- Create a PR | ||
```bash | ||
gh pr create --title "Release v${NEW_VERSION}" | ||
- Create draft GitHub release | ||
```bash | ||
gh release create -d --generate-notes v${NEW_VERSION} | ||
``` | ||
- Update GitHub release notes | ||
- Merge release PR | ||
- Publish GitHub release | ||
- Send notification to RocketChat #annoucements & #general channels | ||
- Assign issue to post release to social media channels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters