-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support version upgrade for MSI packages #1786
Conversation
@@ -35,6 +35,9 @@ docker run --rm -it -v "$(pwd)":/usr/local/src/your-app ferrarimarco/github-chan | |||
# bump the version | |||
echo "${RELEASE_VERSION}" >VERSION | |||
|
|||
#update aws-otel-collector msi file | |||
sed -i '' "s/\(<Product [^>]*Version=\"\)[^\"]*\"/\1${RELEASE_VERSION:1}\"/" tools/packaging/windows/aws-otel-collector.wxs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you post test results for this oneliner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried running it locally but the file was not updated
RELEASE_VERSION=0.26.0 sed -i '' "s/\(<Product [^>]*Version=\"\)[^\"]*\"/\1${RELEASE_VERSION:1}\"/" tools/packaging/windows/aws-otel-collector.wxs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, does RELEASE_VERSION
usually include a v
prefix? Do we need to remove that before doing the search and replace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please add a comment saying that this only supports [0-9]*.[0-9]*.[0-9]*
version pattern. If we decide to release with a full sem ver vX.XX.XX-prerelease
then the .wxs
file will need to be manually updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, does RELEASE_VERSION usually include a v prefix? Do we need to remove that before doing the search and replace
the RELEASE_VERSION has 'v' prefix it is but this first character is removed by ${RELEASE_VERSION:1}
Also, please add a comment saying that this only supports [0-9].[0-9].[0-9]* version pattern. If we decide to release with a full sem ver vX.XX.XX-prerelease then the .wxs file will need to be manually updated.
Added it in PR description along with comment inside the shell script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RELEASE_VERSION=v0.26.0 sed -i '' "s/^Version\=\"[0-9]*.[0-9]*.[0-9]*\"/Version=\"${RELEASE_VERSION:1}\"/" tools/packaging/windows/aws-otel-collector.wxs
Results in Version=".26.0"
when I run it locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disregard above. This was a local environment issue. I can confirm it works.
Closing in favor of #1808 |
Description:
This PR super-seeds #1764. Two major changes are defined in the PR
The new functionality updates the
version
attribute inside tools/packaging/windows/aws-otel-collector.wxs when bump-version-and-create-release-note.sh is run as part of CD process. This will ensure we build windows packages with the right versionAccording to wix documentation, it is advised to have a static product ID when building packages so introduced a unique string to update this.
Add
MajorUpgrade
tag to ensure new version of collector uninstalls the older version of ADOT collector and installs the new one. This mitigates the issue of two collectors being installed and run simultaneously.Note-1: Currently the sed patterm supports [0-9].[0-9].[0-9]* version pattern. If we ever decide to release with a full semantic version with prefix as
vX.XX.XX-prerelease
then the.wxs
file will need to be manually updatedNote-2: We need not update the CD workflow as mentioned in issue #1765. We update the aws-otel-collector.wxs with value inside VERSIONS. So just checking the
VERSION
with the version inputted in theCD workflow dispatch
would be enough to ensure an incorrect version of windows is not released. This is already been done hereTesting:
Tested locally buy building different versions of ADOT windows packages and installing them on a local machine
Will add screenshots in a while
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.