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

Commit 2f511f4

Browse files
committed
feat(release): prepare release notes
Signed-off-by: Paul Pietkiewicz <paul@profian.com>
1 parent 0d365ba commit 2f511f4

File tree

2 files changed

+267
-1
lines changed

2 files changed

+267
-1
lines changed

docs/Contributing/Release.md

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