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

Commit 85ea36c

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

File tree

2 files changed

+205
-1
lines changed

2 files changed

+205
-1
lines changed

docs/Contributing/Release.md

+204
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
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=$(basename $PWD)
137+
```
138+
- Get latest updates and checkout branch
139+
```bash
140+
git fetch --all
141+
git checkout origin/main
142+
git checkout -b "b${MAJOR}.${MINOR}.z"
143+
```
144+
- Bump version inside sub-crate `src/bin/{shim-kvm,shim-sgx,exec-wasmtime}/Cargo.toml` files
145+
```bash
146+
for d in src/bin/*/ ; do ( cd "$d"
147+
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml
148+
cargo update -p $(basename ${d})
149+
done
150+
sed -i 's/^version = .*/version = \"'${NEW_VERSION}'\"/' Cargo.toml
151+
cargo update -p $(grep name Cargo.toml | cut -d'"' -f2)
152+
```
153+
- _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_
154+
```bash
155+
export UPDATED_PREREQUISTES=(xsave sallyport)
156+
for d in src/bin/*/ ; do ( cd "$d"
157+
for p in ${UPDATED_PREREQUISTES[@]]}; do
158+
cargo update -p "${p}"
159+
done
160+
done
161+
for p in ${UPDATED_PREREQUISTES[@]]}; do cargo update -p ${p}; done
162+
```
163+
- Run unit tests
164+
```bash
165+
cargo clean
166+
cargo build
167+
cargo test
168+
```
169+
- Check cargo manifest
170+
```bash
171+
cargo package --allow-dirty -l
172+
```
173+
- Commit change and push to repo
174+
```bash
175+
git commit -asS -m "chore(release): Release v${NEW_VERSION}"
176+
git push origin "release/${NEW_VERSION}"
177+
```
178+
- Create and push `git` tag
179+
```bash
180+
git tag --sign -m "chore(release): Release v${NEW_VERSION}" v${NEW_VERSION}
181+
git push --tags origin "b${MAJOR}.${MINOR}.z"
182+
```
183+
- Package and publish Enarx crate
184+
```bash
185+
cargo publish -v
186+
```
187+
- Create a PR
188+
```bash
189+
gh pr create --title "Release v${NEW_VERSION}" -b
190+
- Create draft GitHub release
191+
```bash
192+
gh release create -d --generate-notes "v${NEW_VERSION}"
193+
```
194+
- Update GitHub release notes
195+
- Merge release PR
196+
- Once PR is merged, then push the tag
197+
```bash
198+
git fetch --all
199+
git push --tags upstream "b${MAJOR}.${MINOR}.z"
200+
```
201+
- Publish GitHub release
202+
-
203+
- Send notification to RocketChat #annoucements & #general channels
204+
- 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)