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

Commit b80fe21

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

File tree

2 files changed

+266
-1
lines changed

2 files changed

+266
-1
lines changed

docs/Contributing/Release.md

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