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