File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 17
17
required : false
18
18
type : boolean
19
19
default : false
20
+ rc :
21
+ description : ' Tag image as rc'
22
+ required : false
23
+ type : boolean
24
+ default : false
20
25
workflow_dispatch :
21
26
22
27
name : ci-build
@@ -145,6 +150,7 @@ jobs:
145
150
tags : |
146
151
type=raw,value={{branch}},enable=${{ github.ref_type == 'branch' && github.event_name != 'pull_request' }}
147
152
type=raw,value=latest,enable=${{ inputs.latest || false }}
153
+ type=raw,value=rc,enable=${{ inputs.rc || false }}
148
154
type=ref,event=branch
149
155
type=ref,event=pr
150
156
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
@@ -156,7 +162,7 @@ jobs:
156
162
with :
157
163
context : .
158
164
file : Dockerfile
159
- push : ${{ inputs.latest || (github.ref_protected && github.event_name != 'pull_request') }}
165
+ push : ${{ inputs.latest || inputs.rc || (github.ref_protected && github.event_name != 'pull_request') }}
160
166
tags : ${{ steps.meta.outputs.tags }}
161
167
labels : ${{ steps.meta.outputs.labels }}
162
168
platforms : ${{ inputs.platforms || 'linux/amd64' }}
@@ -194,4 +200,4 @@ jobs:
194
200
name : OpenShock Desktop Photino Linux
195
201
path : publish/Photino-Linux/*
196
202
retention-days : 7
197
- if-no-files-found : error
203
+ if-no-files-found : error
Original file line number Diff line number Diff line change @@ -18,17 +18,37 @@ jobs:
18
18
- name : Find latest tag
19
19
id : latest-tag
20
20
uses : oprypin/find-latest-tag@v1
21
+ continue-on-error : true
21
22
with :
22
23
repository : ${{ github.repository }}
23
- regex : ' ^\d+\.\d+\.\d+(-[0-9A-Za-z]+(\.\d+)*)?$'
24
+ # Ignore preview or RC tags when searching for the latest
25
+ regex : ' ^\d+\.\d+\.\d+$'
24
26
releases-only : false
25
27
- name : Set output
26
28
run : echo "latest-tag=${{ steps.latest-tag.outputs.tag }}"
27
29
30
+ # Pre-job to find the latest RC tag
31
+ get-latest-rc-tag :
32
+ runs-on : ubuntu-latest
33
+ outputs :
34
+ latest-rc : ${{ steps.latest-rc.outputs.tag }}
35
+ steps :
36
+ - name : Find latest RC tag
37
+ id : latest-rc
38
+ uses : oprypin/find-latest-tag@v1
39
+ continue-on-error : true
40
+ with :
41
+ repository : ${{ github.repository }}
42
+ regex : ' ^\d+\.\d+\.\d+-rc\.\d+$'
43
+ releases-only : false
44
+ - name : Set output
45
+ run : echo "latest-rc=${{ steps.latest-rc.outputs.tag }}"
46
+
28
47
# Delegate building and containerizing to a single workflow.
29
48
build :
30
- needs : get-latest-tag
49
+ needs : [ get-latest-tag, get-latest-rc-tag]
31
50
uses : ./.github/workflows/ci-build.yml
32
51
with :
33
52
platforms : linux/amd64,linux/arm64
34
- latest : ${{ needs.get-latest-tag.outputs.latest-tag == github.ref_name }}
53
+ latest : ${{ needs.get-latest-tag.outputs.latest-tag == github.ref_name }}
54
+ rc : ${{ needs.get-latest-rc-tag.outputs.latest-rc == github.ref_name }}
You can’t perform that action at this time.
0 commit comments