Skip to content

Commit c125c3d

Browse files
authored
feat: tagging pg 17 with cli on actual release (#2108)
1 parent 0a47f15 commit c125c3d

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

.github/workflows/ami-release-nix.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ jobs:
229229
tag_name: ${{ steps.process_release_version.outputs.version }}
230230
target_commitish: ${{github.sha}}
231231

232+
- name: Create CLI tag for PG 17
233+
if: matrix.postgres_version == '17' && github.event_name != 'workflow_dispatch'
234+
env:
235+
GH_TOKEN: ${{ github.token }}
236+
run: |
237+
VERSION="${{ steps.process_release_version.outputs.version }}"
238+
CLI_TAG="v${VERSION}-cli"
239+
echo "Creating CLI tag: ${CLI_TAG}"
240+
git tag "${CLI_TAG}" "${{ github.sha }}"
241+
git push origin "${CLI_TAG}"
242+
232243
- name: Trigger pg_upgrade_scripts workflow
233244
env:
234245
GH_TOKEN: ${{ github.token }}

nix/hooks.nix

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ in
1212
{
1313
imports = [ inputs.git-hooks.flakeModule ];
1414
perSystem =
15-
{ config, ... }:
15+
{ config, pkgs, ... }:
1616
{
1717
pre-commit = {
1818
check.enable = true;
@@ -30,6 +30,27 @@ in
3030
pass_filenames = false;
3131
verbose = true;
3232
};
33+
34+
no-cli-in-postgres-release = {
35+
enable = true;
36+
name = "no-cli-in-postgres-release";
37+
description = "Prevent -cli suffix in postgres_release values in ansible/vars.yml";
38+
entry = builtins.toString (
39+
pkgs.writeShellScript "no-cli-in-postgres-release" ''
40+
if [ -f ansible/vars.yml ]; then
41+
if ${pkgs.gnugrep}/bin/grep -E '^\s+postgres(orioledb-)?[0-9]+:.*-cli' ansible/vars.yml; then
42+
echo ""
43+
echo "ERROR: postgres_release values in ansible/vars.yml must not contain '-cli' suffix."
44+
echo "The -cli tag is generated automatically by the AMI release workflow."
45+
exit 1
46+
fi
47+
fi
48+
''
49+
);
50+
files = "^ansible/vars\\.yml$";
51+
language = "system";
52+
verbose = true;
53+
};
3354
};
3455
};
3556
};

0 commit comments

Comments
 (0)