File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1111 type : boolean
1212 required : false
1313 default : true
14+ app_version :
15+ description : ' Application version'
16+ type : string
17+ required : false
18+ default : ' '
1419
1520# Cancel in-progress runs for the same PR
1621concurrency :
@@ -34,18 +39,32 @@ jobs:
3439 timeout-minutes : 1
3540 run : |
3641 githubHeadRef=${{ env.githubHeadRef }}
42+ inputVersion="${{ inputs.app_version }}"
3743 latestDockerTag=""
3844 versionDockerTag=""
3945 majorVersionDockerTag=""
4046 minorVersionDockerTag=""
4147 version="0.0.1"
4248
43- if [[ "$githubRef" =~ ^"refs/tags/" ]]; then
49+ if [[ -n "$inputVersion" ]]; then
50+ # Version provided via input (manual release)
51+ branch="main"
52+ latestDockerTag="latest"
53+ versionDockerTag="$inputVersion"
54+ version="$inputVersion"
55+
56+ # Extract major and minor versions for additional tags
57+ if [[ "$versionDockerTag" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
58+ majorVersionDockerTag="${BASH_REMATCH[1]}"
59+ minorVersionDockerTag="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
60+ fi
61+ elif [[ "$githubRef" =~ ^"refs/tags/" ]]; then
62+ # Tag push
4463 branch=${githubRef##*/}
4564 latestDockerTag="latest"
4665 versionDockerTag=${branch#v}
4766 version=${branch#v}
48-
67+
4968 # Extract major and minor versions for additional tags
5069 if [[ "$versionDockerTag" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
5170 majorVersionDockerTag="${BASH_REMATCH[1]}"
Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ jobs:
149149 uses : ./.github/workflows/build-docker.yml
150150 with :
151151 push_docker : ${{ needs.validate.outputs.is_tag == 'true' || github.event.inputs.pushDocker == 'true' }}
152+ app_version : ${{ needs.validate.outputs.app_version }}
152153 secrets : inherit
153154
154155 # Create GitHub release
You can’t perform that action at this time.
0 commit comments