Skip to content

Commit 5adc6f7

Browse files
authored
Merge pull request #15 from devilbox/release-0.1.27
Use boolean types
2 parents 20226cd + 159f680 commit 5adc6f7

File tree

4 files changed

+51
-52
lines changed

4 files changed

+51
-52
lines changed

.github/workflows/docker-multistage-build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ on:
1111
description: 'The build matrix'
1212
required: true
1313
type: string
14-
has_refs:
15-
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
16-
required: true
17-
type: string
18-
artifact_prefix:
19-
description: 'Unique artifact name prefix (to avoid overriding existing artifcats during parallel runs).'
20-
required: true
21-
type: string
2214
flavour:
2315
description: 'The flavour to build (Examples: base, mods, prod or work).'
2416
required: true
@@ -27,6 +19,14 @@ on:
2719
description: 'The previous flavour (used for downloading previous artifact).'
2820
required: true
2921
type: string
22+
artifact_prefix:
23+
description: 'Unique artifact name prefix (to avoid overriding existing artifcats during parallel runs).'
24+
required: true
25+
type: string
26+
has_refs:
27+
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
28+
required: true
29+
type: boolean
3030
run_tests:
3131
description: 'Dertermines whether we run integration tests or not.'
3232
required: true
@@ -56,14 +56,14 @@ jobs:
5656
uses: actions/checkout@v3
5757
with:
5858
fetch-depth: 0
59-
if: inputs.has_refs == 0
59+
if: !inputs.has_refs
6060

6161
- name: "[SETUP] Checkout repository (ref: ${{ matrix.refs }})"
6262
uses: actions/checkout@v3
6363
with:
6464
fetch-depth: 0
6565
ref: ${{ matrix.refs }}
66-
if: inputs.has_refs != 0
66+
if: inputs.has_refs
6767

6868
- name: "[SETUP] Setup QEMU environment"
6969
uses: docker/setup-qemu-action@v1

.github/workflows/docker-multistage-configure.yml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@ name: "Configure multistage docker images (multi -flavours, -versions, -architec
33

44
on:
55
workflow_call:
6-
76
###
87
### Input Variables
98
###
109
inputs:
10+
versions:
11+
description: 'The JSON string for versions. ( list of objects: [{NAME, VERSION[], ARCH[]}] )'
12+
required: true
13+
type: string
14+
refs:
15+
description: 'The JSON string for refs. ( object: {BRANCH, NUM_LATEST_TAGS} )'
16+
required: true
17+
type: string
1118
enabled:
1219
description: 'Determines whether this workflow is enabled at all (will run or skip).'
1320
required: true
@@ -20,14 +27,6 @@ on:
2027
description: "Usage for a scheduled job? Only then we will evaluate git refs and add them to build matrix."
2128
required: true
2229
type: boolean
23-
versions:
24-
description: 'The JSON string for versions. ( list of objects: [{NAME, VERSION[], ARCH[]}] )'
25-
required: true
26-
type: string
27-
refs:
28-
description: 'The JSON string for refs. ( object: {BRANCH, NUM_LATEST_TAGS} )'
29-
required: true
30-
type: string
3130

3231
###
3332
### Input Secrets
@@ -46,30 +45,30 @@ on:
4645
outputs:
4746
# Repeat input variables
4847
versions:
49-
description: "Copied from inputs: The JSON string for versions."
48+
description: "(string) Copied from inputs: The JSON string for versions."
5049
value: ${{ jobs.configure.outputs.versions }}
5150
refs:
52-
description: "Copied from inputs: The JSON string for refs."
51+
description: "(string) Copied from inputs: The JSON string for refs."
5352
value: ${{ jobs.configure.outputs.refs }}
5453
# Determined settings (flags)
5554
can_login:
56-
description: "Can we login to Dockerhub?"
55+
description: "(boolean) Can we login to Dockerhub?"
5756
value: ${{ jobs.configure.outputs.can_login }}
5857
can_push:
59-
description: "Can we push to Dockerhub?"
58+
description: "(boolean) Can we push to Dockerhub?"
6059
value: ${{ jobs.configure.outputs.can_push }}
6160
has_refs:
62-
description: "Do we have refs? (used for nightly builds)"
61+
description: "(boolean) Do we have refs? (used for nightly builds)"
6362
value: ${{ jobs.configure.outputs.has_refs }}
6463
# Determined settings (values)
6564
matrix_build:
66-
description: "The determined build matrix"
65+
description: "(string) The determined JSON string build matrix."
6766
value: ${{ jobs.configure.outputs.matrix_build }}
6867
matrix_deploy:
69-
description: "The determined deploy matrix"
68+
description: "(string) The determined JSON string deploy matrix."
7069
value: ${{ jobs.configure.outputs.matrix_deploy }}
7170
artifact_prefix:
72-
description: "The determined unique artifact prefix"
71+
description: "(string) The determined unique artifact prefix."
7372
value: ${{ jobs.configure.outputs.artifact_prefix }}
7473

7574
jobs:
@@ -115,9 +114,9 @@ jobs:
115114
shell: bash
116115
run: |
117116
if [ "${{ env.ENV_USER }}" = '' ] || [ "${{ env.ENV_PASS }}" = '' ]; then
118-
echo "::set-output name=can_login::0"
117+
echo "::set-output name=can_login::false"
119118
else
120-
echo "::set-output name=can_login::1"
119+
echo "::set-output name=can_login::true"
121120
fi
122121
env:
123122
ENV_USER: ${{ secrets.dockerhub_username }}
@@ -130,10 +129,10 @@ jobs:
130129
id: set-push
131130
shell: bash
132131
run: |
133-
if [ "${{ steps.set-login.outputs.can_login }}" = "1" ] && [ "${{ inputs.can_deploy }}" = "1" ]; then
134-
echo "::set-output name=can_push::1"
132+
if [ "${{ steps.set-login.outputs.can_login }}" = "true" ] && [ "${{ inputs.can_deploy }}" = "true" ]; then
133+
echo "::set-output name=can_push::true"
135134
else
136-
echo "::set-output name=can_push::0"
135+
echo "::set-output name=can_push::false"
137136
fi
138137
139138
###
@@ -155,7 +154,7 @@ jobs:
155154
156155
- name: "[Set-Output] has_refs and matrix (ref-matrix) (branches and latest tags)"
157156
id: set-refs
158-
uses: cytopia/git-ref-matrix-action@v0.1.8
157+
uses: cytopia/git-ref-matrix-action@v0.1.9
159158
with:
160159
repository_default_branch: ${{ steps.eval-refs.outputs.default_branch }}
161160
branches: ${{ steps.eval-refs.outputs.branches }}
@@ -186,7 +185,7 @@ jobs:
186185
id: set-matrix
187186
shell: bash
188187
run: |
189-
if [ "${{ steps.set-refs.outputs.has_refs }}" = "1" ]; then
188+
if [ "${{ steps.set-refs.outputs.has_refs }}" = "true" ]; then
190189
MATRIX_BUILD="$( \
191190
jq -M -c \
192191
--argjson refs '${{ steps.set-refs.outputs.matrix }}' \

.github/workflows/docker-multistage-push.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@ on:
77
### Variables
88
###
99
inputs:
10-
can_deploy:
11-
description: 'Determines wheather this workflow will also deploy (login and push).'
12-
required: true
13-
type: boolean
1410
matrix:
1511
description: 'The build matrix'
1612
required: true
1713
type: string
18-
has_refs:
19-
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
14+
flavour:
15+
description: 'The flavour to build (Examples: base, mods, prod or work).'
2016
required: true
2117
type: string
2218
artifact_prefix:
2319
description: 'Unique artifact name prefix (to avoid overriding existing artifcats during parallel runs).'
2420
required: true
2521
type: string
26-
flavour:
27-
description: 'The flavour to build (Examples: base, mods, prod or work).'
22+
can_deploy:
23+
description: 'Determines wheather this workflow will also deploy (login and push).'
2824
required: true
29-
type: string
25+
type: boolean
26+
has_refs:
27+
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
28+
required: true
29+
type: boolean
3030
###
3131
### Secrets
3232
###
@@ -58,14 +58,14 @@ jobs:
5858
uses: actions/checkout@v3
5959
with:
6060
fetch-depth: 0
61-
if: inputs.has_refs == 0
61+
if: !inputs.has_refs
6262

6363
- name: "[SETUP] Checkout repository (ref: ${{ matrix.refs }})"
6464
uses: actions/checkout@v3
6565
with:
6666
fetch-depth: 0
6767
ref: ${{ matrix.refs }}
68-
if: inputs.has_refs != 0
68+
if: inputs.has_refs
6969

7070
- name: "[SETUP] Setup QEMU environment"
7171
uses: docker/setup-qemu-action@v1

.github/workflows/docker-multistage-test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ on:
1111
description: 'The build matrix'
1212
required: true
1313
type: string
14-
has_refs:
15-
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
14+
flavour:
15+
description: 'The flavour to build (Examples: base, mods, prod or work).'
1616
required: true
1717
type: string
1818
artifact_prefix:
1919
description: 'Unique artifact name prefix (to avoid overriding existing artifcats during parallel runs).'
2020
required: true
2121
type: string
22-
flavour:
23-
description: 'The flavour to build (Examples: base, mods, prod or work).'
22+
has_refs:
23+
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
2424
required: true
25-
type: string
25+
type: boolean
2626

2727
jobs:
2828
# -----------------------------------------------------------------------------------------------
@@ -44,14 +44,14 @@ jobs:
4444
uses: actions/checkout@v3
4545
with:
4646
fetch-depth: 0
47-
if: inputs.has_refs == 0
47+
if: !inputs.has_refs
4848

4949
- name: "[SETUP] Checkout repository (ref: ${{ matrix.refs }})"
5050
uses: actions/checkout@v3
5151
with:
5252
fetch-depth: 0
5353
ref: ${{ matrix.refs }}
54-
if: inputs.has_refs != 0
54+
if: inputs.has_refs
5555

5656
- name: "[SETUP] Setup QEMU environment"
5757
uses: docker/setup-qemu-action@v1

0 commit comments

Comments
 (0)