Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from paralta/multimod-release
Browse files Browse the repository at this point in the history
test: multimod release
  • Loading branch information
paralta authored Feb 23, 2024
2 parents a7c0d2a + db98163 commit f18163f
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 28 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
if-no-files-found: error
compression-level: 0

main_release:
prerelease:
needs:
- verification
- build_and_push
Expand All @@ -125,10 +125,17 @@ jobs:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Delete tag
# env:
# VERSION: ${{ github.ref_name }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push origin :${{ github.ref_name }}

- name: Create and push module tags
# env:
# VERSION: ${{ github.ref_name }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make multimod-push-tags

- name: Download artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
Expand All @@ -142,34 +149,27 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make generate-release-notes

main_release:
needs:
- prerelease
name: Release
runs-on: ubuntu-latest
strategy:
matrix:
tags: ["uibackend/types", "uibackend/server", "uibackend/client", "core", "provider", "utils", "installation", "cli", "testenv", "api/types", "api/server", "api/client", "e2e", "containerruntimediscovery/types", "containerruntimediscovery/server", "containerruntimediscovery/client", "orchestrator"]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "dist/*.tar.gz,dist/*.sha256sum,dist/bicep/vmclarity.json,dist/bicep/vmclarity-UI.json"
bodyFile: "dist/CHANGELOG.md"
draft: true
name: "Release ${{ github.ref_name }}"
name: "Release ${{ matrix.tags }}"
updateOnlyUnreleased: true

# TODO(sambetts) We need to publish a tag in the format "api/<version>" tag
# so that go mod is able to import the api module without overriding. We need
# to work out how to do this cleanly from github actions on release so that
# we don't need to manage it manually. We could do something this which will
# create another release:
#
# api_release:
# needs: release
# name: Release API Module
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Release API
# uses: softprops/action-gh-release@v1
# with:
# name: VMClarity {{ github.ref }} API
# body: See main {{ github.ref }} release for release notes.
# tag_name: api/{{ github.ref }}
tag: ${{ matrix.tags }}/${{ github.ref_name }}
1 change: 1 addition & 0 deletions .github/workflows/semantic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
revert
style
test
release
scopes: |
api
Expand Down
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,19 @@ endif

$(DIST_DIR)/CHANGELOG.md: $(ROOT_DIR)/cliff.toml bin/git-cliff | $(DIST_DIR)
$(GITCLIFF_BIN) --config $(ROOT_DIR)/cliff.toml --output $@ $(GITCLIFF_OPTS)

.PHONY: multimod-verify
multimod-verify: bin/multimod
@echo "Validating versions.yaml file"
$(MULTIMOD_BIN) verify

.PHONY: multimod-prerelease
multimod-prerelease: bin/multimod
$(MULTIMOD_BIN) prerelease --all-module-sets --skip-go-mod-tidy=true --commit-to-different-branch=false

.PHONY: multimod-push-tags
multimod-push-tags: bin/multimod
set -e; for tag in `$(MULTIMOD_BIN) tag --module-set-name vmclarity --commit-hash HEAD --print-tags | grep -v "Using" `; do \
echo "pushing tag $${tag}"; \
git push origin $${tag}; \
done;
62 changes: 62 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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 with the changes.

## 3. Create and Push Tag

* After the pull request is approved and merged, update your local main branch.
```sh
git checkout main
git pull origin main
```

* Create and push a new tag in order to trigger the `Release` workflow.
```sh
git tag -a v0.7.0
git push origin v0.7.0
```

## Post-release Checks
Verify that the `Release` workflow was completed successfully in the GitHub Actions section.
Ensure that the release is visible in the GitHub releases page. Additionally, check that the release description is correct and all assets are listed.
12 changes: 12 additions & 0 deletions makefile.d/20-tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,15 @@ bin/typos-$(TYPOS_VERSION): | $(BIN_DIR)
@curl -sSfL 'https://github.com/crate-ci/typos/releases/download/v$(TYPOS_VERSION)/typos-v$(TYPOS_VERSION)-$(TYPOS_ARCH)-$(TYPOS_OSTYPE).tar.gz' --output - \
| tar xzvOf - './typos' > $@
@chmod +x $@

####
## Go MultiMod Releaser
####

MULTIMOD_BIN := $(BIN_DIR)/multimod
MULTIMOD_REPO_DIR := $(BIN_DIR)/opentelemetry-go-build-tools

bin/multimod:
@if [ ! -d $(MULTIMOD_REPO_DIR) ]; then git clone [email protected]:open-telemetry/opentelemetry-go-build-tools.git $(MULTIMOD_REPO_DIR); fi
@cd $(MULTIMOD_REPO_DIR)/multimod && go build -o $(MULTIMOD_BIN) main.go
@rm -rf $(MULTIMOD_REPO_DIR)
21 changes: 21 additions & 0 deletions versions.yaml
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

0 comments on commit f18163f

Please sign in to comment.