Skip to content

Commit 30d86fc

Browse files
committed
refactor workflow, enable release branches for release images and update patch versions for rel-13.x
1 parent 0d0783c commit 30d86fc

2 files changed

Lines changed: 32 additions & 58 deletions

File tree

.github/workflows/build-test-images.yml

Lines changed: 28 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,55 @@ on:
77

88
workflow_dispatch:
99

10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1017
jobs:
1118
prepare_pgversion_matrix:
1219
runs-on: ubuntu-latest
1320
steps:
1421
# Need the repo checked out in order to read the file
15-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v6
1623
- id: get_versions
17-
run: cat circleci/images/PG_VERSIONS >> $GITHUB_OUTPUT
24+
shell: bash
25+
run: |
26+
versions=$(cut -d= -f2 circleci/images/PG_VERSIONS | jq -R -s -c 'split("\n")[:-1]')
27+
echo "pgversions=${versions}" >> "$GITHUB_OUTPUT"
1828
outputs:
19-
# Will look like '["13.9", "14.6", "15.1"]'
20-
pgversions: ${{ toJSON(steps.get_versions.outputs.*) }}
29+
# Will look like '["15.17", "16.13", "17.9", "18.3"]'
30+
pgversions: ${{ steps.get_versions.outputs.pgversions }}
2131

22-
build_dev_images_per_postgres:
23-
if: github.ref_name != 'master'
24-
name: push-test-images-for-dev
32+
build_images_per_postgres:
33+
name: push-test-images-per-postgres
2534
runs-on: ubuntu-latest
2635
permissions:
2736
packages: write
2837
needs:
2938
- prepare_pgversion_matrix
3039
env:
31-
RELEASE_FLAG: ""
40+
RELEASE_FLAG: ${{ (github.ref_name == 'master' || startsWith(github.ref_name, 'release-')) && '1' || '' }}
3241
strategy:
3342
fail-fast: false
3443
matrix:
3544
command: [extbuilder, exttester, failtester]
3645
pgversion: ${{ fromJSON(needs.prepare_pgversion_matrix.outputs.pgversions) }}
3746

38-
steps: &build_images_per_pg_steps
47+
steps:
3948
- name: Checkout repository
40-
uses: actions/checkout@v4
49+
uses: actions/checkout@v6
4150

4251
- name: 'Login to GitHub Container Registry'
43-
uses: docker/login-action@v3
52+
uses: docker/login-action@v4
4453
with:
4554
registry: ghcr.io
4655
username: ${{ github.actor }}
4756
password: ${{ secrets.GITHUB_TOKEN }}
4857

49-
# If current branch is not master,build and publish dev image
58+
# Build and publish release/dev image based on RELEASE_FLAG
5059
- name: Build & Push images
5160
run: |
5261
cd circleci/images
@@ -56,31 +65,30 @@ jobs:
5665
make push-${{ matrix.command }}-${{ matrix.pgversion }}
5766
fi
5867
59-
build_dev_images_shared:
60-
if: github.ref_name != 'master'
61-
name: push-test-images-for-dev
68+
build_images_shared:
69+
name: push-test-images-shared
6270
runs-on: ubuntu-latest
6371
permissions:
6472
packages: write
6573
env:
66-
RELEASE_FLAG: ""
74+
RELEASE_FLAG: ${{ (github.ref_name == 'master' || startsWith(github.ref_name, 'release-')) && '1' || '' }}
6775
strategy:
6876
fail-fast: false
6977
matrix:
7078
command: [citusupgradetester, pgupgradetester, stylechecker]
7179

72-
steps: &build_shared_image_steps
80+
steps:
7381
- name: Checkout repository
74-
uses: actions/checkout@v4
82+
uses: actions/checkout@v6
7583

7684
- name: 'Login to GitHub Container Registry'
77-
uses: docker/login-action@v3
85+
uses: docker/login-action@v4
7886
with:
7987
registry: ghcr.io
8088
username: ${{ github.actor }}
8189
password: ${{ secrets.GITHUB_TOKEN }}
8290

83-
# If current branch is not master,build and publish dev image
91+
# Build and publish release/dev image based on RELEASE_FLAG
8492
- name: Build & Push images
8593
run: |
8694
cd circleci/images
@@ -89,35 +97,3 @@ jobs:
8997
else
9098
make push-${{ matrix.command }}-all
9199
fi
92-
93-
94-
build_release_images:
95-
if: github.ref_name == 'master'
96-
needs: prepare_pgversion_matrix
97-
name: push-test-images-for-release
98-
runs-on: ubuntu-latest
99-
permissions:
100-
packages: write
101-
env:
102-
RELEASE_FLAG: "1"
103-
strategy:
104-
fail-fast: false
105-
matrix:
106-
command: [extbuilder, exttester, failtester]
107-
pgversion: ${{ fromJSON(needs.prepare_pgversion_matrix.outputs.pgversions) }}
108-
109-
steps: *build_images_per_pg_steps
110-
111-
build_release_images_shared:
112-
if: github.ref_name == 'master'
113-
name: push-shared-images-for-release
114-
runs-on: ubuntu-latest
115-
permissions:
116-
packages: write
117-
env:
118-
RELEASE_FLAG: "1"
119-
strategy:
120-
fail-fast: false
121-
matrix:
122-
command: [citusupgradetester, pgupgradetester, stylechecker]
123-
steps: *build_shared_image_steps

circleci/images/Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ STYLE_CHECKER_TOOLS_VERSION=0.8.18
1818

1919
# Upgrade tests for the PG major versions from PG_VERSIONS file
2020
CITUS_UPGRADE_PG_VERSIONS=$(shell head PG_VERSIONS|cut -c 6-|tr '\n' ' ')
21-
CITUS_UPGRADE_VERSIONS_15=v12.1.10
22-
# 12.1.10 is the latest release of Citus 12 when the test is expanded to cover Citus 12
23-
CITUS_UPGRADE_VERSIONS_16=v12.1.10
21+
CITUS_UPGRADE_VERSIONS_15=v12.1.11
22+
# Latest minor version of Citus 12
23+
CITUS_UPGRADE_VERSIONS_16=v12.1.11
2424
# Latest minor version of Citus 13
25-
CITUS_UPGRADE_VERSIONS_17=v13.2.0
26-
# Latest minor version of Citus 14
27-
CITUS_UPGRADE_VERSIONS_18=v14.0.0
25+
CITUS_UPGRADE_VERSIONS_17=v13.2.1
2826

2927
# Function to get Citus versions for a specific PG major version
3028
get_citus_versions = $(CITUS_UPGRADE_VERSIONS_$(1))

0 commit comments

Comments
 (0)