This repository was archived by the owner on Oct 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add release for multiple modules (#1276)
* feat: create module set for release with all modules * feat: build multimod * feat: add multimod verify and prerelease * feat: add create and push tags * docs: improve release instructions * refactor: code review * feat: create module tags once release is published * docs: improve release instructions * release: pin multimod version * refactor: clone with https Co-authored-by: Ramiz Polic <[email protected]> --------- Co-authored-by: Ramiz Polic <[email protected]>
- Loading branch information
1 parent
85a84b9
commit 18a837a
Showing
7 changed files
with
156 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Post Release | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
prepare: | ||
name: Prepare | ||
runs-on: ubuntu-latest | ||
outputs: | ||
modules: ${{ steps.modules.outputs.modules }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Get modules | ||
id: modules | ||
run: | | ||
# shellcheck disable=SC2016 | ||
echo "modules=$(find . -name go.mod -type f -print0 | xargs -0 awk '/module/ {print $2}' | jq -c -R '[.,inputs] | map(sub("^github.com\/openclarity\/vmclarity\/";""))')" >> "$GITHUB_OUTPUT" | ||
create_module_tags: | ||
needs: | ||
- prepare | ||
name: Create module tags | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
tags: ${{ fromJson(needs.prepare.outputs.modules) }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Create tags | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: 'refs/tags/${{ matrix.tags }}/${{ github.ref_name }}', | ||
sha: context.sha | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ jobs: | |
revert | ||
style | ||
test | ||
release | ||
scopes: | | ||
api | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Release | ||
|
||
This document outlines the process for creating a new release for VMClarity using the [Go MultiMod Releaser](https://github.com/open-telemetry/opentelemetry-go-build-tools/tree/main/multimod). All code block examples provided below correspond to an update to version `v0.7.0`, please update accordingly. | ||
|
||
## 1. Update the New Release Version | ||
|
||
* Create a new branch for the release version update. | ||
```sh | ||
git checkout -b release/v0.7.0 | ||
``` | ||
|
||
* Modify the `versions.yaml` file to update the version for VMClarity's module-set. Keep in mind that the same version is applied to all modules. | ||
```diff | ||
vmclarity: | ||
- version: v0.6.0 | ||
+ version: v0.7.0 | ||
``` | ||
|
||
* Commit the changes with a suitable message. | ||
```sh | ||
git add versions.yaml | ||
git commit -m "release: update module set to version v0.7.0" | ||
``` | ||
|
||
* Run the version verification command to check for any issues. | ||
```sh | ||
make multimod-verify | ||
``` | ||
|
||
## 2. Bump All Dependencies to the New Release Version | ||
|
||
* Run the following command to update all `go.mod` files to the new release version. | ||
```sh | ||
make multimod-prerelease | ||
``` | ||
|
||
* Review the changes made in the last commit to ensure correctness. | ||
|
||
* Push the branch to the GitHub repository. | ||
```sh | ||
git push origin release/v0.7.0 | ||
``` | ||
|
||
* Create a pull request for these changes with a title like "release: prepare version v0.7.0". | ||
|
||
## 3. Create and Push Tags | ||
|
||
* After the pull request is approved and merged, update your local main branch. | ||
```sh | ||
git checkout main | ||
git pull origin main | ||
``` | ||
|
||
* To trigger the release workflow, create and push to the repository a release tag for the last commit. | ||
```sh | ||
git tag -a v0.7.0 | ||
git push origin v0.7.0 | ||
``` | ||
|
||
Please note that the release tag is not necessarily associated with the "release: prepare version v0.7.0" commit. For example, if any bug fixes were required after this commit, they can be merged and included in the release. | ||
|
||
## 4. Publish release | ||
|
||
* Wait until the release workflow is completed successfully. | ||
|
||
* Navigate to the [Releases page](https://github.com/openclarity/vmclarity/releases) and verify the draft release description as well as the assets listed. | ||
|
||
* Once the draft release has been verified, click on `Edit` release and then on `Publish Release`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module-sets: | ||
vmclarity: | ||
version: v0.6.0 | ||
modules: | ||
- github.com/openclarity/vmclarity/uibackend/types | ||
- github.com/openclarity/vmclarity/uibackend/server | ||
- github.com/openclarity/vmclarity/uibackend/client | ||
- github.com/openclarity/vmclarity/core | ||
- github.com/openclarity/vmclarity/provider | ||
- github.com/openclarity/vmclarity/utils | ||
- github.com/openclarity/vmclarity/installation | ||
- github.com/openclarity/vmclarity/cli | ||
- github.com/openclarity/vmclarity/testenv | ||
- github.com/openclarity/vmclarity/api/types | ||
- github.com/openclarity/vmclarity/api/server | ||
- github.com/openclarity/vmclarity/api/client | ||
- github.com/openclarity/vmclarity/e2e | ||
- github.com/openclarity/vmclarity/containerruntimediscovery/types | ||
- github.com/openclarity/vmclarity/containerruntimediscovery/server | ||
- github.com/openclarity/vmclarity/containerruntimediscovery/client | ||
- github.com/openclarity/vmclarity/orchestrator |