Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

Commit 73de035

Browse files
committed
feat(release): prepare release notes
Signed-off-by: Paul Pietkiewicz <[email protected]>
1 parent 0d365ba commit 73de035

File tree

2 files changed

+235
-1
lines changed

2 files changed

+235
-1
lines changed

docs/Contributing/Release.md

+234
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
# Release Process
2+
3+
## Prerequisites:
4+
- Prepare release notes
5+
- `cargo` credentials are cached
6+
- `git` credentials are available on host to allow pushing code
7+
- `gh` installed and configured
8+
- You are running the build process on a X86_64 host
9+
- Freeze all merges until release process complete
10+
11+
## Weekly chores
12+
* [Update Rust toolchain](https://github.com/enarx/enarx/actions/workflows/rust-toolchain-update.yml)
13+
* [Update Cargo dependencies](https://github.com/enarx/enarx/actions/workflows/cargo-update.yml)
14+
15+
16+
## Enarx Release
17+
> **NOTE:** Regarding git remotes:
18+
> * `upstream` points to core repository location
19+
> * `origin` points to the user's fork
20+
21+
### Update and release prerequiste crates
22+
> **NOTE:** The list of crates that need to be updated for a release can be seen by running this following command:
23+
> ```bash
24+
> grep -R 'git+https' *.lock | sort | uniq
25+
> ```
26+
> This may be an optional step dependant on whether there are relevant changes in the prerequisite crates, including:
27+
> * [crt0stack](https://github.com/enarx/crt0stack)
28+
> * [flagset](https://github.com/enarx/flagset)
29+
> * [iocuddle](https://github.com/enarx/iocuddle)
30+
> * [lset](https://github.com/enarx/lset)
31+
> * [mmarinus](https://github.com/enarx/mmarinus)
32+
> * [mmledger](https://github.com/enarx/mmledger)
33+
> * [nbytes](https://github.com/enarx/nbytes)
34+
> * [noted](https://github.com/enarx/noted)
35+
> * [primordial](https://github.com/enarx/primordial)
36+
> * [rcrt1](https://github.com/enarx/rcrt1)
37+
> * [sallyport](https://github.com/enarx/sallyport)
38+
> * [sgx](https://github.com/enarx/sgx)
39+
> * [snp](https://github.com/enarx/snp)
40+
> * [vdso](https://github.com/enarx/vdso)
41+
> * [xsave](https://github.com/enarx/xsave)
42+
43+
#### Assumptions:
44+
- All approved PRs are merged
45+
- Rust toolchain (if using snapshot) and `cargo update` has been run
46+
47+
#### Steps:
48+
- Determine expected version by reviewing output of `git log`
49+
- Set new version
50+
```bash
51+
export MAJOR=0
52+
export MINOR=2
53+
export PATCH=2
54+
export NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
55+
```
56+
- Set REPO variable, assuming GitHub repository matches directory name
57+
```bash
58+
export REPO="$(basename $PWD)"
59+
```
60+
- Get latest updates and checkout branch
61+
> **NOTE:** The following assumes a new release
62+
```bash
63+
git fetch upstream
64+
git checkout -b "b${MAJOR}.${MINOR}.z" upstream/main
65+
```
66+
- Determine if crate builds and if it works
67+
```bash
68+
cargo clean
69+
cargo build --release
70+
cargo test
71+
```
72+
- Update version in `Cargo.toml`
73+
```bash
74+
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml
75+
cargo update -p $(grep name Cargo.toml | cut -d'"' -f2)
76+
```
77+
- Run `cargo test` again
78+
```bash
79+
cargo clean
80+
cargo build --release
81+
cargo test
82+
```
83+
- Check if cargo successfully builds with dry run
84+
```bash
85+
cargo publish --allow-dirty -v --dry-run
86+
```
87+
- Commit change and push to repo
88+
```bash
89+
git commit -asS -m "chore(release): Release v${NEW_VERSION}"
90+
git push origin b${MAJOR}.${MINOR}.z
91+
```
92+
- Create a PR
93+
```bash
94+
gh pr create -t "chore(release): Release v${NEW_VERSION}" \
95+
-b "chore(release): Release v${NEW_VERSION}" \
96+
-R enarx/${REPO}
97+
```
98+
- Confirm that changes passed on CI and merge PR
99+
- Checkout merged release branch
100+
```bash
101+
git fetch upstream
102+
git checkout upstream/main
103+
```
104+
- Tag the new release on upstream
105+
```bash
106+
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION}
107+
git push --tags upstream "b${MAJOR}.${MINOR}.z"
108+
```
109+
- Cargo publish
110+
> **NOTE: ** Assuming cargo credentials are cached
111+
```bash
112+
cargo publish -v
113+
```
114+
115+
### The Enarx release itself
116+
- Determine expected version by reviewing output of `git log`
117+
- Set new version
118+
```bash
119+
export MAJOR=0
120+
export MINOR=2
121+
export PATCH=2
122+
export NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
123+
```
124+
- Get latest updates and checkout branch
125+
```bash
126+
git fetch upstream
127+
git checkout -b "b${MAJOR}.${MINOR}.z" upstream/main
128+
```
129+
- Bump version inside sub-crate `src/bin/{shim-kvm,shim-sgx,exec-wasmtime}/Cargo.toml` files
130+
```bash
131+
for d in src/bin/*/ ; do ( cd "$d"
132+
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml
133+
cargo update -p $(basename ${d})
134+
done
135+
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml
136+
cargo update -p $(grep name Cargo.toml | cut -d'"' -f2)
137+
```
138+
- _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_
139+
```bash
140+
export UPDATED_PREREQUISTES=(xsave sallyport)
141+
for d in src/bin/*/ ; do ( cd "$d"
142+
for p in ${UPDATED_PREREQUISTES[@]]}; do
143+
cargo update -p "${p}"
144+
done
145+
done
146+
for p in ${UPDATED_PREREQUISTES[@]]}; do cargo update -p ${p}; done
147+
```
148+
- Run unit tests
149+
```bash
150+
cargo clean
151+
cargo build --release
152+
cargo test
153+
```
154+
- Check cargo manifest
155+
```bash
156+
cargo package --allow-dirty -l
157+
```
158+
- Check if cargo successfully builds with dry run
159+
```bash
160+
cd src/bin/shim-kvm; cargo publish --allow-dirty --dry-run -v --target x86_64-unknown-none; cd ..
161+
cd shim-sgx; cargo publish --allow-dirty --dry-run -v --target x86_64-unknown-none; cd ..
162+
cd exec-wasmtime; cargo publish --allow-dirty --dry-run -v ; cd ../..
163+
```
164+
- Commit change and push to repo
165+
```bash
166+
git commit -asS -m "chore(release): Release v${NEW_VERSION}"
167+
git push origin "release/${NEW_VERSION}"
168+
```
169+
- Packaging binary dependency crates
170+
> **NOTE:** Assuming cargo credentials are cached
171+
```bash
172+
cd src/bin/shim-kvm; cargo publish -v --target x86_64-unknown-none; cd ..
173+
cd shim-sgx; cargo publish -v --target x86_64-unknown-none; cd ..
174+
cd exec-wasmtime; cargo publish -v ; cd ../..
175+
```
176+
- Update enarx dependencies
177+
```bash
178+
export UPDATED_BINDEPS=(enarx-exec-wasmtime enarx-shim-kvm enarx-shim-sgx)
179+
for p in ${UPDATED_PREREQUISTES[@]]}; do
180+
cargo update -p "${p}"
181+
done
182+
```
183+
- Run unit tests
184+
```bash
185+
cargo clean
186+
cargo build --release
187+
cargo test
188+
```
189+
- Cargo dry-run publish
190+
```bash
191+
cargo publish --allow-dirty --dry-run -v
192+
```
193+
- Commit change and push to repo
194+
```bash
195+
git commit -asS --amend
196+
git push --force origin "release/${NEW_VERSION}"
197+
```
198+
- Create a PR
199+
```bash
200+
gh pr create -t "chore(release): Release v${NEW_VERSION}" \
201+
-b "chore(release): Release v${NEW_VERSION}" \
202+
-R enarx/${REPO}
203+
```
204+
- Confirm that changes passed on CI and merge PR
205+
- Checkout merged release branch
206+
```bash
207+
git fetch upstream
208+
git checkout upstream/main
209+
```
210+
- Tag the new release on upstream
211+
```bash
212+
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION}
213+
git push --tags upstream "b${MAJOR}.${MINOR}.z"
214+
```
215+
- Create a release PR
216+
```bash
217+
gh pr create -t "Release v${NEW_VERSION}" \
218+
-b ""
219+
-B main \
220+
-R enarx/enarx
221+
```
222+
- Merge release PR
223+
- Cargo publish
224+
```bash
225+
cargo publish -v
226+
```
227+
- Create draft GitHub release
228+
```bash
229+
gh release create -d --generate-notes "v${NEW_VERSION}"
230+
```
231+
- Update release notes on draft GitHub release
232+
- Publish GitHub release
233+
- Send notification to RocketChat #annoucements & #general channels
234+
- Assign issue to post release to social media channels

sidebars.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const sidebars = {
4141
{
4242
type: 'category',
4343
label: 'Contributing Guide',
44-
items: ['Contributing/Introduction','Contributing/Onboarding','Contributing/Code','Contributing/Coding-Style','Contributing/Git-hook','Contributing/PRs','Contributing/Issues','Contributing/RFCs','Contributing/Docs','Contributing/Outreach','Contributing/Lab'],
44+
items: ['Contributing/Introduction','Contributing/Onboarding','Contributing/Code','Contributing/Coding-Style','Contributing/Git-hook','Contributing/PRs','Contributing/Issues','Contributing/RFCs','Contributing/Docs','Contributing/Outreach','Contributing/Lab', 'Contributing/Release'],
4545
},
4646
{
4747
type: 'category',

0 commit comments

Comments
 (0)