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+
1017jobs :
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
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
0 commit comments