Skip to content

Commit fb13fa4

Browse files
committed
workflow: automatically generate TAG in a form of VERSION-BUILD
1 parent 0eb1181 commit fb13fa4

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

.github/workflows/build_pre_release.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ on:
22
workflow_dispatch:
33
inputs:
44
TAG:
5-
description: 'Tag name to use'
5+
description: 'The tag to use, defaults to VERSION-BUILD'
66
required: false
77
type: string
8+
BUILD:
9+
description: 'The build number to use'
10+
required: false
11+
type: number
12+
default: 1
813

914
env:
1015
REGISTRY: ${{ vars.DOCKERHUB_REGISTRY }}
@@ -16,6 +21,9 @@ jobs:
1621
steps:
1722
- name: Checkout
1823
uses: actions/checkout@v3
24+
- name: Define TAG
25+
if: ${{ !inputs.TAG }}
26+
run: echo "TAG=$(cat VERSION)-${{ inputs.BUILD }}" >> $GITHUB_ENV
1927
- name: Update version in RELEASE.md
2028
shell: bash
2129
run: |
@@ -48,6 +56,9 @@ jobs:
4856
uses: actions/checkout@v3
4957
- name: Set up QEMU
5058
uses: docker/setup-qemu-action@v2
59+
- name: Define TAG
60+
if: ${{ !inputs.TAG }}
61+
run: echo "TAG=$(cat VERSION)-${{ inputs.BUILD }}" >> $GITHUB_ENV
5162

5263
# Compile and release
5364
- name: Compile and release for ${{matrix.arch}}
@@ -98,6 +109,9 @@ jobs:
98109
uses: actions/checkout@v3
99110
- name: Set up QEMU
100111
uses: docker/setup-qemu-action@v2
112+
- name: Define TAG
113+
if: ${{ !inputs.TAG }}
114+
run: echo "TAG=$(cat VERSION)-${{ inputs.BUILD }}" >> $GITHUB_ENV
101115

102116
# Compile the client
103117
- name: Run client for ${{matrix.arch}}
@@ -122,6 +136,9 @@ jobs:
122136
steps:
123137
- name: Checkout
124138
uses: actions/checkout@v3
139+
- name: Define TAG
140+
if: ${{ !inputs.TAG }}
141+
run: echo "TAG=$(cat VERSION)-${{ inputs.BUILD }}" >> $GITHUB_ENV
125142

126143
# Update docker manifest
127144
- name: Login to Docker Hub

.github/workflows/make_release.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ on:
22
workflow_dispatch:
33
inputs:
44
TAG:
5-
description: 'Tag name to use'
5+
description: 'The tag to use, defaults to VERSION-BUILD'
66
required: false
77
type: string
8+
BUILD:
9+
description: 'The build number to use'
10+
required: false
11+
type: number
12+
default: 1
813

914
env:
1015
REGISTRY: ${{ vars.DOCKERHUB_REGISTRY }}
@@ -16,6 +21,9 @@ jobs:
1621
steps:
1722
- name: Checkout
1823
uses: actions/checkout@v3
24+
- name: Define TAG
25+
if: ${{ !inputs.TAG }}
26+
run: echo "TAG=$(cat VERSION)-${{ inputs.BUILD }}" >> $GITHUB_ENV
1927
- name: Login to Docker Hub
2028
uses: docker/login-action@v3
2129
with:

0 commit comments

Comments
 (0)