File tree Expand file tree Collapse file tree 3 files changed +44
-21
lines changed
Expand file tree Collapse file tree 3 files changed +44
-21
lines changed Original file line number Diff line number Diff line change 1+ name : Build converter image
2+
3+ on :
4+ push :
5+ tags :
6+ - ' converter-*'
7+ workflow_dispatch :
8+
9+ jobs :
10+ build_library :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Extract version from tag
14+ id : extract-version
15+ run : |
16+ TAG_NAME="${{ github.ref_name }}"
17+ VERSION=${TAG_NAME#converter-}
18+ PATTERN="^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)*$"
19+ if [[ ! "$VERSION" =~ $PATTERN ]]; then
20+ echo "Invalid version number. Expected format: x.y.z with optional '-rc.n' (e.g., 1.2.3 or 1.2.3-rc.1)"
21+ echo $VERSION
22+ exit 1
23+ fi
24+ echo "version=$VERSION" >> $GITHUB_OUTPUT
25+
26+ - name : Login to Container Registry
27+ uses : docker/login-action@v3
28+ with :
29+ registry : ghcr.io
30+ username : ${{ github.actor }}
31+ password : ${{ secrets.GITHUB_TOKEN }}
32+
33+ - name : Build and push converter service Docker image
34+ uses : docker/build-push-action@v5
35+ with :
36+ push : true
37+ platforms : linux/amd64
38+ tags : ghcr.io/${{ github.repository_owner }}/hub-converter:${{ steps.extract-version.outputs.version }}
39+ context : ./converter
40+ build-args : CONVERTER_VERSION=${{ steps.extract-version.outputs.version }}
Original file line number Diff line number Diff line change 99 default : " main"
1010 type : string
1111 version :
12- description : " RC Version (e.g., 1.2.3-RC-1 or 1.2-RC- 1)"
12+ description : " RC Version (e.g., 1.2.3-rc. 1)"
1313 required : true
1414 type : string
1515
@@ -38,10 +38,10 @@ jobs:
3838 VERSION="${{ github.event.inputs.version }}"
3939 echo "Validating RC version: $VERSION"
4040
41- # Check if version matches x.y.z-RC- n pattern
42- RC_PATTERN="^[0-9]+\.[0-9]+( \.[0-9]+)?+-RC- [0-9]+$"
41+ # Check if version matches x.y.z-rc. n pattern
42+ RC_PATTERN="^[0-9]+\.[0-9]+\.[0-9]+-rc\. [0-9]+$"
4343 if [[ ! "$VERSION" =~ $RC_PATTERN ]]; then
44- echo "Invalid RC version format. Expected format: x.y.z-RC- n (e.g., 1.2.3-RC- 1)"
44+ echo "Invalid RC version format. Expected format: x.y.z-rc. n (e.g., 1.2.3-rc. 1)"
4545 echo "Provided version: $VERSION"
4646 exit 1
4747 fi
Original file line number Diff line number Diff line change 6363 GITHUB_ACTOR : ${{ github.actor }}
6464 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6565 run : ./gradlew -Pversion=${{ steps.extract_info.outputs.version }} publish
66-
67- - name : Login to Container Registry
68- uses : docker/login-action@v3
69- with :
70- registry : ghcr.io
71- username : ${{ github.actor }}
72- password : ${{ secrets.GITHUB_TOKEN }}
73-
74- - name : Build and push converter service Docker image
75- if : steps.extract_info.outputs.project == 'converter'
76- uses : docker/build-push-action@v5
77- with :
78- push : true
79- platforms : linux/amd64
80- tags : ghcr.io/${{ github.repository_owner }}/hub-converter:${{ steps.extract_info.outputs.version }}
81- context : ./converter
82- build-args : CONVERTER_VERSION=${{ steps.extract_info.outputs.version }}
You can’t perform that action at this time.
0 commit comments