Skip to content

Commit

Permalink
Add script that updates versions and commits changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoBonafonte committed Jan 18, 2024
1 parent 36e61ac commit d34da3e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/createRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ jobs:
id: tag_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Update version
run:

run: sh Scripts/updateVersion.sh $GITHUB_TOKEN ${{ steps.tag_version.outputs.VERSION }}
10 changes: 10 additions & 0 deletions Scripts/updateVersion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# This script expects two inputs
# $1 - The github token for opentelemetry-swift
# $2 - the git tag

#Update version number
sed -E -i '' 's/public static let OTEL_SWIFT_SDK_VERSION = ".+"/public static let OTEL_SWIFT_SDK_VERSION = "'$2\"/ ./Sources/OpenTelemetrySdk/Version.swift
git commit -m "Updated version number to $2"
git tag -f $2
git push -f --tags origin HEAD:main
2 changes: 1 addition & 1 deletion Sources/OpenTelemetrySdk/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
import Foundation

extension Resource {
public static let OTEL_SWIFT_SDK_VERSION : String = "1.8.0"
public static let OTEL_SWIFT_SDK_VERSION = "1.8.0"
}

0 comments on commit d34da3e

Please sign in to comment.