File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed
Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -43,15 +43,15 @@ jobs:
4343 - name : Check out code
4444 uses : actions/checkout@v4
4545
46- - name : Read version from file
47- id : get_version
46+ - name : Setup envs
47+ id : setup_envs
4848 run : |
49- ls -la
50- echo "VERSION=$(cat version)" >> $GITHUB_ENV
49+ VERSION=$(git tag --merged $BRANCH_NAME --sort=-v:refname | head -n 1)
50+ if [ -z "$VERSION" ]; then
51+ VERSION="3.18.0"
52+ fi
53+ echo "VERSION=$VERSION" >> $GITHUB_ENV
5154
52- - name : Get branch name
53- id : get_branch
54- run : |
5555 if [ "${{ github.event_name }}" == "pull_request" ]; then
5656 BRANCH_NAME=${{ github.head_ref }}
5757 else
6161 SANITIZED_BRANCH_NAME=$(echo "$BRANCH_NAME" | tr -cs '[:alnum:]' '-' | sed 's/-*$//' | tr '[:upper:]' '[:lower:]')
6262 echo "BRANCH_NAME=$SANITIZED_BRANCH_NAME" >> $GITHUB_ENV
6363
64- - name : Get short commit SHA
65- id : get_commit
66- run : echo "COMMIT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
64+ echo "TIMESTAMP=$(date -u +'%y%m%d%H%M')" >> $GITHUB_ENV
65+
66+ echo "COMMIT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
6767
6868 - name : Set up QEMU
6969 uses : docker/setup-qemu-action@v3
8787 file : ./build/Dockerfile
8888 context : .
8989 push : true
90- tags : ghcr.io/${{ github.repository }}:${{ env.VERSION }}-${{ env.BRANCH_NAME }}-${{ env.COMMIT_SHA }}
90+ tags : ghcr.io/${{ github.repository }}:${{ env.VERSION }}-${{ env.BRANCH_NAME }}-${{ env.TIMESTAMP }}.${{ env. COMMIT_SHA }}
9191 platforms : linux/amd64,linux/arm64
9292
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ FROM $BUILDER_IMAGE AS builder
1717WORKDIR /workspace
1818
1919# Copy the go source
20- COPY version version
2120COPY api/ api/
2221COPY cmd/ cmd/
2322COPY internal/ internal/
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments