-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b6836d
commit 02ffd46
Showing
5 changed files
with
135 additions
and
9 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,24 @@ | ||
name: create-new-release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
type: string | ||
required: true | ||
description: New version to set | ||
commit: | ||
type: string | ||
required: false | ||
description: Commit of of which to build new version. If not provided will use HEAD | ||
default: dev/dev-ci-fixes-stage # todo: Update this for after demo | ||
|
||
jobs: | ||
build-stage: | ||
name: Build stage | ||
uses: ./.github/workflows/release-stage.yaml | ||
with: | ||
ref: ${{ inputs.commit }} | ||
version: ${{ inputs.version }} | ||
build-number: ${{ github.run_number }} | ||
secrets: inherit |
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
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,56 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# Function definitions | ||
# | ||
function update_version() { | ||
VERSION="$1" | ||
BUILD_TYPE=$2 | ||
PARENT_POM="pom.xml" | ||
PUBLIC_POM="client/deploy-resources/${BUILD_TYPE}_pom.xml" | ||
|
||
# Detecting host type. `sed` on bsd and linux are not the same | ||
if [[ "$(uname)" == "Darwin" ]]; then | ||
sed -i "" "s#<revision>[^<]*</revision>#<revision>${VERSION}</revision>#g" "$PARENT_POM" | ||
sed -i "" "1,/<version>[^<]*<\/version>/ s#<version>[^<]*</version>#<version>${VERSION}</version>#" "$PUBLIC_POM" | ||
else | ||
sed -i "s#<revision>[^<]*</revision>#<revision>${VERSION}</revision>#g" "$PARENT_POM" | ||
sed -i "0,/<version>[^<]*<\/version>/ s//<version>${VERSION}<\/version>/" "$PUBLIC_POM" | ||
fi | ||
} | ||
|
||
function main() { | ||
VERSION=$1 | ||
BUILD_TYPE=$2 | ||
|
||
# If version has been set using set_crypto we are honoring that setting | ||
if [ -f "bouncycastle.config" ];then | ||
BUILD_TYPE="bouncycastle" | ||
elif [ -f "gnu.config" ];then | ||
BUILD_TYPE="gnu" | ||
fi | ||
|
||
update_version $VERSION $BUILD_TYPE | ||
} | ||
|
||
# | ||
# Main entry | ||
# | ||
VERSION=$1 | ||
BUILD_TYPE=${2:-"gnu"} | ||
REGEX="^[0-9]+\.[0-9]+\.[0-9]+$" | ||
|
||
if [ -z $VERSION ];then | ||
printf "Missing version ..." | ||
|
||
exit 1 | ||
elif [[ ! "$1" =~ $REGEX ]];then | ||
printf "Version format not valid. Valid format are [0 - 9].[0 - 9].[0 - 9]" | ||
|
||
exit 1 | ||
else | ||
# Call main | ||
main $VERSION $BUILD_TYPE | ||
|
||
exit 0 | ||
fi |