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

Commit abfa9e7

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

File tree

2 files changed

+245
-1
lines changed

2 files changed

+245
-1
lines changed

docs/Contributing/Release.md

+244
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
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+
43+
- Determine expected version by reviewing output of `git log`
44+
- Set new version
45+
```bash
46+
export MAJOR=0
47+
export MINOR=2
48+
export PATCH=2
49+
export NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
50+
```
51+
- Set REPO variable, assuming GitHub repository matches directory name
52+
```bash
53+
export REPO="$(basename $PWD)"
54+
```
55+
- Get latest updates and checkout branch
56+
> **NOTE:** The following assumes a new release
57+
```bash
58+
git fetch upstream
59+
git checkout -b "b${MAJOR}.${MINOR}.z" upstream/main
60+
```
61+
- Determine if crate builds and if it works
62+
```bash
63+
cargo clean
64+
cargo build
65+
cargo test
66+
```
67+
- Update version in `Cargo.toml`
68+
```bash
69+
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml
70+
cargo update -p $(grep name Cargo.toml | cut -d'"' -f2)
71+
```
72+
- Run `cargo test` again
73+
```bash
74+
cargo clean
75+
cargo build
76+
cargo test
77+
```
78+
- Commit change and push to repo
79+
```bash
80+
git commit -asS -m "chore(release): Release v${NEW_VERSION}"
81+
git push origin b${MAJOR}.${MINOR}.z
82+
```
83+
- Create a git tag
84+
```bash
85+
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION}
86+
git push --tags origin "b${MAJOR}.${MINOR}.z"
87+
```
88+
- Create a PR
89+
```bash
90+
gh pr create -t "chore(release): Release v${NEW_VERSION}" \
91+
-b "chore(release): Release v${NEW_VERSION}" \
92+
-B "b${MAJOR}.${MINOR}.z" \
93+
-R enarx/${REPO}
94+
```
95+
- Confirm that changes passed on CI and merge PR
96+
- Checkout merged release branch
97+
```bash
98+
git fetch --all
99+
git branch -u upstream/"b${MAJOR}.${MINOR}.z"
100+
git reset --hard upstream/"b${MAJOR}.${MINOR}.z"
101+
```
102+
- Tag the new release on upstream
103+
```bash
104+
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION}
105+
git push --tags upstream "b${MAJOR}.${MINOR}.z"
106+
```
107+
- Cargo publish
108+
> **NOTE: ** Assuming cargo credentials are cached
109+
```bash
110+
cargo publish -v
111+
```
112+
- Create a release PR
113+
```bash
114+
gh pr create -t "Release v${NEW_VERSION}" \
115+
-b ""
116+
-B main \
117+
-R enarx/${REPO}
118+
```
119+
- Merge release PR
120+
- Create draft GitHub release
121+
```bash
122+
gh release create "v${NEW_VERSION}"
123+
```
124+
125+
### The Enarx release itself
126+
- Determine expected version by reviewing output of `git log`
127+
- Set new version
128+
```bash
129+
export MAJOR=0
130+
export MINOR=2
131+
export PATCH=2
132+
export NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
133+
```
134+
- Set REPO variable, assuming GitHub repository matches directory name
135+
```bash
136+
export REPO="enarx"
137+
```
138+
- Get latest updates and checkout branch
139+
```bash
140+
git fetch upstream
141+
git checkout -b "b${MAJOR}.${MINOR}.z" upstream/main
142+
```
143+
- Bump version inside sub-crate `src/bin/{shim-kvm,shim-sgx,exec-wasmtime}/Cargo.toml` files
144+
```bash
145+
for d in src/bin/*/ ; do ( cd "$d"
146+
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml
147+
cargo update -p $(basename ${d})
148+
done
149+
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml
150+
cargo update -p $(grep name Cargo.toml | cut -d'"' -f2)
151+
```
152+
- _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_
153+
```bash
154+
export UPDATED_PREREQUISTES=(xsave sallyport)
155+
for d in src/bin/*/ ; do ( cd "$d"
156+
for p in ${UPDATED_PREREQUISTES[@]]}; do
157+
cargo update -p "${p}"
158+
done
159+
done
160+
for p in ${UPDATED_PREREQUISTES[@]]}; do cargo update -p ${p}; done
161+
```
162+
- Run unit tests
163+
```bash
164+
cargo clean
165+
cargo build
166+
cargo test
167+
```
168+
- Check cargo manifest
169+
```bash
170+
cargo package --allow-dirty -l
171+
```
172+
- Commit change and push to repo
173+
```bash
174+
git commit -asS -m "chore(release): Release v${NEW_VERSION}"
175+
git push origin "release/${NEW_VERSION}"
176+
```
177+
- Create and push `git` tag
178+
```bash
179+
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION}
180+
git push --tags origin "b${MAJOR}.${MINOR}.z"
181+
```
182+
- Packaging binary dependency crates
183+
```bash
184+
cd src/bin/shim-kvm; cargo publish -v --target x86_64-unknown-none; cd ..
185+
cd src/bin/shim-sgx; cargo publish -v --target x86_64-unknown-none; cd ..
186+
cd src/bin/exec-wasmtime; cargo publish -v --target x86_64-unknown-none; cd ../..
187+
```
188+
- Update enarx dependencies
189+
```bash
190+
export UPDATED_BINDEPS=(enarx-exec-wasmtime enarx-shim-kvm enarx-shim-sgx)
191+
for p in ${UPDATED_PREREQUISTES[@]]}; do
192+
cargo update -p "${p}"
193+
done
194+
```
195+
- Commit change and push to repo
196+
```bash
197+
git commit -asS --amend
198+
git push --force origin "release/${NEW_VERSION}"
199+
```
200+
- Create and push `git` tag
201+
```bash
202+
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION}
203+
git push --tags --force origin "b${MAJOR}.${MINOR}.z"
204+
```
205+
- Create a PR
206+
```bash
207+
gh pr create -t "chore(release): Release v${NEW_VERSION}" \
208+
-b "chore(release): Release v${NEW_VERSION}" \
209+
-B "b${MAJOR}.${MINOR}.z" \
210+
-R enarx/${REPO}
211+
```
212+
- Confirm that changes passed on CI and merge PR
213+
- Checkout merged release branch
214+
```bash
215+
git fetch --all
216+
git branch -u upstream/"b${MAJOR}.${MINOR}.z"
217+
git reset --hard upstream/"b${MAJOR}.${MINOR}.z"
218+
```
219+
- Tag the new release on upstream
220+
```bash
221+
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION}
222+
git push --tags upstream "b${MAJOR}.${MINOR}.z"
223+
```
224+
- Cargo publish
225+
> **NOTE: ** Assuming cargo credentials are cached
226+
```bash
227+
cargo publish -v
228+
```
229+
- Create a release PR
230+
```bash
231+
gh pr create -t "Release v${NEW_VERSION}" \
232+
-b ""
233+
-B main \
234+
-R enarx/${REPO}
235+
```
236+
- Merge release PR
237+
- Create draft GitHub release
238+
```bash
239+
gh release create -d --generate-notes "v${NEW_VERSION}"
240+
```
241+
- Update release notes on draft release
242+
- Publish release
243+
- Send notification to RocketChat #annoucements & #general channels
244+
- 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)