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

Commit b7fd5d4

Browse files
committed
Prepare release notes
Signed-off-by: Paul Pietkiewicz <[email protected]>
1 parent 10612fd commit b7fd5d4

File tree

2 files changed

+189
-1
lines changed

2 files changed

+189
-1
lines changed

docs/Contributing/Release.md

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Release Process
2+
3+
## Prerequisites:
4+
- Prepare release notes
5+
6+
7+
## Weekly chores
8+
### Enarx dependency update
9+
- Update local code
10+
```bash
11+
git fetch --all
12+
git checkout origin/main
13+
```
14+
- Checkout chore branch
15+
```bash
16+
git checkout -b chore/cargo-update
17+
```
18+
- Run `cargo update` within all individual sub-crates
19+
```bash
20+
for d in internal/*/ ; do (cd "$d" && cargo update); done
21+
```
22+
- Git commit sub-crate update
23+
```bash
24+
git commit -asS -m 'chore(deps): update internal crate dependencies'
25+
```
26+
- Run cargo update on `enarx`
27+
```bash
28+
cargo update
29+
```
30+
- Git commit sub-crate update
31+
```bash
32+
git commit -asS -m 'chore(deps): update Enarx dependencies'
33+
```
34+
- Run build and tests
35+
```bash
36+
cargo clean
37+
cargo build
38+
cargo tests
39+
```
40+
- Create PR
41+
```bash
42+
git push origin chore/cargo-update
43+
gh pr create --title "chore(deps): update Enarx dependencies"
44+
```
45+
46+
47+
## Enarx Release
48+
49+
### Update and release prerequiste crates
50+
> **NOTE: ** This may be an optional step dependant on whether there are relevant changes in the prerequisite crates (e.g. `xsave`, `sallyport`, etc.):
51+
- Determine expected version by reviewing output of `git log`
52+
- Set new version
53+
```bash
54+
export MAJOR=0
55+
export MINOR=2
56+
export PATCH=2
57+
export NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
58+
```
59+
- Ensure all approved PRs are merged
60+
- Get latest updates and checkout branch
61+
```bash
62+
git fetch --all
63+
git checkout origin/main
64+
git checkout -b b${MAJOR}.${MINOR}.z
65+
```
66+
- Update dependencies
67+
```bash
68+
cargo update
69+
```
70+
- Determine if crate builds and if it works
71+
```bash
72+
cargo clean
73+
cargo build
74+
cargo test
75+
```
76+
- Update version in `Cargo.toml`
77+
```bash
78+
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml
79+
cargo update -p $(grep name Cargo.toml | cut -d'"' -f2)
80+
```
81+
- Run `cargo test` again
82+
```bash
83+
cargo clean
84+
cargo build
85+
cargo test
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
91+
```
92+
- Confirm that changes passed on CI
93+
- Create a git tag
94+
```bash
95+
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION}
96+
git push --tags origin b${MAJOR}.${MINOR}.z
97+
```
98+
- Cargo publish
99+
```bash
100+
cargo publish
101+
```
102+
- Create a PR
103+
```bash
104+
gh pr create --title "Release v${NEW_VERSION}"
105+
```
106+
107+
### The Enarx release itself
108+
- Determine expected version by reviewing output of `git log`
109+
- Set new version
110+
```bash
111+
export MAJOR=0
112+
export MINOR=2
113+
export PATCH=2
114+
export NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
115+
```
116+
- Get latest updates and checkout branch
117+
```bash
118+
git fetch --all
119+
git checkout origin/main
120+
git checkout -b b${MAJOR}.${MINOR}.z
121+
```
122+
- Bump version inside sub-crate `internal/{shim-sev,shim-sgx,wasmdr}/Cargo.toml` files
123+
```bash
124+
for d in internal/*/ ; do ( cd "$d"
125+
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml
126+
cargo update -p $(basename ${d})
127+
git mv Cargo.toml Cargo.tml )
128+
done
129+
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml
130+
cargo update -p enarx
131+
```
132+
- _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_
133+
```bash
134+
export UPDATED_PREREQUISTES=(xsave sallyport)
135+
for d in internal/*/ ; do ( cd "$d"
136+
for p in ${UPDATED_PREREQUISTES[@]]}; do
137+
cargo update -p ${p}
138+
done
139+
done
140+
for p in ${UPDATED_PREREQUISTES[@]]}; do cargo update -p ${p}; done
141+
```
142+
- Run unit tests
143+
```bash
144+
cargo clean
145+
cargo build
146+
cargo test
147+
```
148+
- Rename Cargo.toml to Cargo.tml in sub-crates to address `cargo` sub-crate limitation
149+
```bash
150+
for d in internal/*/ ; do ( cd "$d"
151+
git mv Cargo.toml Cargo.tml )
152+
done
153+
- Check cargo manifest
154+
```bash
155+
cargo package --allow-dirty -l
156+
```
157+
- Commit change and push to repo
158+
```bash
159+
git commit -asS -m "chore(release): Release v${NEW_VERSION}"
160+
git push origin release/${NEW_VERSION}
161+
```
162+
- Create and push `git` tag
163+
```bash
164+
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION}
165+
git push --tags origin b${MAJOR}.${MINOR}.z
166+
```
167+
- Package and publish Enarx crate
168+
```bash
169+
cargo publish -v
170+
```
171+
- Restore Cargo.tml files to Cargo.toml files
172+
```bash
173+
for i in internal/*/Cargo.tml; do git mv $i ${i%.tml}.toml; done
174+
git commit -asS -m 'chore(release): put back Cargo.toml files'
175+
git push origin b${MAJOR}.${MINOR}.z
176+
```
177+
- Create a PR
178+
```bash
179+
gh pr create --title "Release v${NEW_VERSION}"
180+
- Create draft GitHub release
181+
```bash
182+
gh release create -d --generate-notes v${NEW_VERSION}
183+
```
184+
- Update GitHub release notes
185+
- Merge release PR
186+
- Publish GitHub release
187+
- Send notification to RocketChat #annoucements & #general channels
188+
- Assign issue to post release to social media channels

sidebars.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const sidebars = {
3131
{
3232
type: 'category',
3333
label: 'Contributing Guide',
34-
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'],
34+
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'],
3535
},
3636
{
3737
type: 'category',

0 commit comments

Comments
 (0)