Skip to content

Commit 01d0ef7

Browse files
committed
Add optional suffix for image and branch tagging
1 parent 2acbaa2 commit 01d0ef7

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
ref:
88
description: 'Ref to build'
99
required: true
10+
suffix:
11+
description: 'Optional image tag suffix'
12+
required: false
1013
push:
1114
tags:
1215
'*'

.github/workflows/patch-release.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
description: 'Specify an upstream version tag'
99
required: true
1010
default: 'v1.23.1'
11+
suffix:
12+
description: 'Optional image tag suffix'
13+
default: ''
14+
required: false
1115

1216
jobs:
1317
patch-upstream:
@@ -38,7 +42,7 @@ jobs:
3842
fi
3943
4044
- name: Create branch from determined tag
41-
run: git checkout tags/${{ inputs.tag }} -b apply-patches-${{ inputs.tag }}
45+
run: git checkout tags/${{ inputs.tag }} -b apply-patches-${{ inputs.tag }}${{ inputs.suffix }}
4246

4347
- name: Configure Git user
4448
run: |
@@ -57,15 +61,15 @@ jobs:
5761
env:
5862
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
5963
run: |
60-
git tag -d "${{ inputs.tag }}" || echo "Local tag does not exist, skipping delete."
61-
git push --delete origin "${{ inputs.tag }}" || echo "Remote tag does not exist, skipping delete."
62-
git tag -a "${{ inputs.tag }}" -m "Tagging version ${{ inputs.tag }} after applying patches"
63-
git push origin "${{ inputs.tag }}" --force
64-
echo '{"ref":"${{ inputs.tag }}"}' | gh workflow run build.yml --ref "ci" --repo "blender/gitea" --json
64+
git tag -d "${{ inputs.tag }}${{ inputs.suffix }}" || echo "Local tag does not exist, skipping delete."
65+
git push --delete origin "${{ inputs.tag }}${{ inputs.suffix }}" || echo "Remote tag does not exist, skipping delete."
66+
git tag -a "${{ inputs.tag }}${{ inputs.suffix }}" -m "Tagging version ${{ inputs.tag }} after applying patches"
67+
git push origin "${{ inputs.tag }}${{ inputs.suffix }}" --force
68+
echo '{"ref":"${{ inputs.tag }}${{ inputs.suffix }}"}' | gh workflow run build.yml --ref "${{ github.ref_name }}" --repo "blender/gitea" --json
6569
6670
- name: Push branch
6771
if: always()
68-
run: git push origin apply-patches-${{ inputs.tag }} --force
72+
run: git push origin apply-patches-${{ inputs.tag }}${{ inputs.suffix }} --force
6973
env:
7074
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
7175

0 commit comments

Comments
 (0)