-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1883 from Adyen/chore/release_process_version_number
Release process - version number
- Loading branch information
Showing
12 changed files
with
73 additions
and
129 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
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: Generate version name | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
version-name: | ||
description: "The version name of the current release" | ||
value: ${{ jobs.generate_version_name.outputs.version-name }} | ||
|
||
jobs: | ||
generate_version_name: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version-name: ${{ steps.generate_version_name.outputs.version_name }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Generate version name | ||
id: generate_version_name | ||
run: | | ||
chmod +x scripts/version_name.sh | ||
VERSION_NAME=$(./scripts/version_name.sh) | ||
echo "version_name=$VERSION_NAME" >> $GITHUB_OUTPUT | ||
echo $VERSION_NAME |
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 was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,18 +1,22 @@ | ||
#!/bin/bash | ||
|
||
function release_version() { | ||
local build_file="${GITHUB_WORKSPACE}/gradle/libs.versions.toml" | ||
local version_name_key="version-name" | ||
local version_name_regex="^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(-(alpha|beta|rc)[0-9]{2}){0,1}$" | ||
local branch_name=$(git branch --show-current) | ||
|
||
if [[ $branch_name != release/* ]]; then | ||
echo "Error: invalid branch name. Branch name should start with \"release/\"." | ||
exit 1 | ||
fi | ||
|
||
local version=$(sed -n "s/.*${version_name_key}[[:space:]]*=[[:space:]]*[\"\']\(.*\)[\"\'].*/\1/p" ${build_file}) | ||
local version_name="${branch_name#*release/}" | ||
local version_name_regex="^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(-(alpha|beta|rc)[0-9]{2}){0,1}$" | ||
|
||
if [[ ! ${version} =~ ${version_name_regex} ]]; then | ||
echo "Error: invalid version name [$version], please validate that [$version_name_key] at [$build_file] follows regex $version_name_regex ." | ||
if [[ ! ${version_name} =~ ${version_name_regex} ]]; then | ||
echo "Error: invalid version name: $version_name. Please make sure that the name follows this pattern: $version_name_regex ." | ||
exit 1 | ||
fi | ||
|
||
echo "$version" | ||
echo "$version_name" | ||
} | ||
|
||
release_version |