Skip to content

Commit 8783236

Browse files
support-meaningful-release-branching (#525)
Summary: - Support for parallel versioned release branches. - Docker tagging improved on semver and latest tags. - Enable `stackql/stackql-devel` docker image zero touch. - Linter on all version branches.
1 parent 3a72e3c commit 8783236

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

.github/workflows/build.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
- develop
8+
- version*
89
tags:
910
- build*
1011
paths-ignore:
@@ -17,6 +18,7 @@ on:
1718
branches:
1819
- main
1920
- develop
21+
- version*
2022
paths-ignore:
2123
- "**/*.md"
2224
- "docs/**"
@@ -1272,13 +1274,16 @@ jobs:
12721274
# shellcheck disable=SC2235
12731275
if ( \
12741276
[ "${{ github.repository }}" = "stackql/stackql" ] \
1275-
|| [ "${{ github.repository }}" != "stackql/stackql-devel" ] \
1277+
|| [ "${{ github.repository }}" = "stackql/stackql-devel" ] \
12761278
) \
12771279
&& [ "${{ vars.CI_SKIP_DOCKER_PUSH }}" != "true" ] \
12781280
&& [ "$( grep '^build-elide.*' <<< '${{ github.ref_name }}' )" = "" ] \
12791281
&& ( \
12801282
[ "${{ github.ref_type }}" = "branch" ] \
1281-
&& [ "${{ github.ref_name }}" = "main" ] \
1283+
&& ( \
1284+
[ "${{ github.ref_name }}" = "main" ] \
1285+
|| [[ "${{ github.ref_name }}" =~ ^version.* ]] \
1286+
) \
12821287
&& [ "${{ github.event_name }}" = "push" ] \
12831288
) \
12841289
|| ( \
@@ -1292,7 +1297,9 @@ jobs:
12921297
echo "IMAGE_PLATFORM_SAN=$( sed 's/\//_/g' <<< '${{ matrix.platform }}' )";
12931298
echo "PUSH_IMAGE_REQUIRED=${PUSH_IMAGE_REQUIRED}";
12941299
echo "BUILD_IMAGE_REQUIRED=${BUILD_IMAGE_REQUIRED}";
1300+
echo "SHORTHAND_DOCKER_TAG=${SHORTHAND_DOCKER_TAG}";
12951301
} | tee -a "${GITHUB_ENV}"
1302+
12961303
12971304
- name: Extract Build Info and Persist
12981305
env:
@@ -1418,13 +1425,16 @@ jobs:
14181425
# shellcheck disable=SC2235
14191426
if ( \
14201427
[ "${{ github.repository }}" = "stackql/stackql" ] \
1421-
|| [ "${{ github.repository }}" != "stackql/stackql-devel" ] \
1428+
|| [ "${{ github.repository }}" = "stackql/stackql-devel" ] \
14221429
) \
14231430
&& [ "${{ vars.CI_SKIP_DOCKER_PUSH }}" != "true" ] \
14241431
&& [ "$( grep '^build-elide.*' <<< '${{ github.ref_name }}' )" = "" ] \
14251432
&& ( \
14261433
[ "${{ github.ref_type }}" = "branch" ] \
1427-
&& [ "${{ github.ref_name }}" = "main" ] \
1434+
&& ( \
1435+
[ "${{ github.ref_name }}" = "main" ] \
1436+
|| [[ "${{ github.ref_name }}" =~ ^version.* ]] \
1437+
) \
14281438
&& [ "${{ github.event_name }}" = "push" ] \
14291439
) \
14301440
|| ( \
@@ -1624,13 +1634,16 @@ jobs:
16241634
# shellcheck disable=SC2235
16251635
if ( \
16261636
[ "${{ github.repository }}" = "stackql/stackql" ] \
1627-
|| [ "${{ github.repository }}" != "stackql/stackql-devel" ] \
1637+
|| [ "${{ github.repository }}" = "stackql/stackql-devel" ] \
16281638
) \
16291639
&& [ "${{ vars.CI_SKIP_DOCKER_PUSH }}" != "true" ] \
16301640
&& [ "$( grep '^build-elide.*' <<< '${{ github.ref_name }}' )" = "" ] \
16311641
&& ( \
16321642
[ "${{ github.ref_type }}" = "branch" ] \
1633-
&& [ "${{ github.ref_name }}" = "main" ] \
1643+
&& ( \
1644+
[ "${{ github.ref_name }}" = "main" ] \
1645+
|| [[ "${{ github.ref_name }}" =~ ^version.* ]] \
1646+
) \
16341647
&& [ "${{ github.event_name }}" = "push" ] \
16351648
) \
16361649
|| ( \
@@ -1678,6 +1691,14 @@ jobs:
16781691
# shellcheck disable=2269
16791692
BUILDPATCHVERSION="${BUILDPATCHVERSION}"
16801693
fi
1694+
if \
1695+
[ "${{ github.ref_type }}" = "branch" ] \
1696+
&& [ "${{ github.ref_name }}" = "main" ] \
1697+
; then
1698+
SHORTHAND_DOCKER_TAG="latest"
1699+
else
1700+
SHORTHAND_DOCKER_TAG="${{ github.ref_name }}"
1701+
fi
16811702
BUILDSHORTCOMMITSHA="$(echo "${BUILDCOMMITSHA}" | cut -c 1-7)"
16821703
BUILDDATE="$(date)"
16831704
export BUILDDATE
@@ -1695,6 +1716,7 @@ jobs:
16951716
echo "BUILDPATCHVERSION=$BUILDPATCHVERSION"
16961717
echo "UID=${UID}"
16971718
echo "GID=${GID}"
1719+
echo "SHORTHAND_DOCKER_TAG=${SHORTHAND_DOCKER_TAG}"
16981720
} >> "${GITHUB_ENV}"
16991721
17001722
- name: Docker meta
@@ -1707,8 +1729,9 @@ jobs:
17071729
tags: |
17081730
type=ref,event=branch
17091731
type=ref,event=pr
1710-
type=raw,value=latest
1732+
type=raw,value=${{env.SHORTHAND_DOCKER_TAG}}
17111733
type=raw,value=v${{env.BUILDMAJORVERSION}}.${{env.BUILDMINORVERSION}}.${{env.BUILDPATCHVERSION}}
1734+
type=raw,value=v${{env.BUILDMAJORVERSION}}.${{env.BUILDMINORVERSION}}
17121735
type=raw,value=${{ github.sha }}
17131736
17141737
- name: Create manifest list and push

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- version*
78
tags:
89
- lint*
910
- build*

0 commit comments

Comments
 (0)