From 203b8661399de4fac9a435c6d05614cf1988851a Mon Sep 17 00:00:00 2001 From: sdi Date: Mon, 11 Aug 2025 11:27:47 +0300 Subject: [PATCH] Add deb13 build. remove old images --- .github/workflows/images.yml | 31 --------------------- .github/workflows/main.yml | 53 ++++++++++++++++++++++++++++++------ ci/bookworm-build.Dockerfile | 23 ---------------- ci/bullseye-build.Dockerfile | 21 -------------- ci/deploy.sh | 31 --------------------- 5 files changed, 45 insertions(+), 114 deletions(-) delete mode 100644 .github/workflows/images.yml delete mode 100644 ci/bookworm-build.Dockerfile delete mode 100644 ci/bullseye-build.Dockerfile delete mode 100755 ci/deploy.sh diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml deleted file mode 100644 index 5ce0886..0000000 --- a/.github/workflows/images.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build docker images -on: - workflow_dispatch: - schedule: - - cron: '6 9 * * SUN' - -jobs: - deb11-build-image: - name: Build deb11 images for CI - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - steps: - - uses: actions/checkout@v2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Push Bullseye build image - uses: docker/build-push-action@v2 - with: - context: . - file: ci/bullseye-build.Dockerfile - push: true - tags: ghcr.io/${{ github.repository_owner }}/postgresql/build-image:bullseye - diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00d990e..38d3aa1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ on: - 'v*' jobs: - build: + deb12-build: runs-on: ubuntu-latest container: debian:bookworm steps: @@ -38,25 +38,62 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: pkg + name: deb12-pkg path: '*.deb' retention-days: 1 - deploy: - needs: build - if: startsWith(github.ref, 'refs/tags/v') + - uses: yeti-switch/upload-debian-pkg-action@v2 + with: + pkgs: '*.deb' + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} + s3_component: bookworm + s3_access_key_id: ${{ secrets.DEB_AWS_ACCESS_KEY_ID }} + s3_secret_access_key: ${{ secrets.DEB_AWS_SECRET_ACCESS_KEY }} + s3_endpoint_url: ${{ secrets.DEB_AWS_ENDPOINT }} + s3_prefix: '1.14' + if: startsWith(github.ref, 'refs/tags/v') + + deb13-build: runs-on: ubuntu-latest - container: debian:bookworm + container: debian:trixie steps: - - uses: actions/download-artifact@v4 + - name: install aux deps + run: apt update && apt -y --no-install-recommends install git ca-certificates curl gpg make + + - name: add pgdg pkg repo + run: > + echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt trixie-pgdg main" >> /etc/apt/sources.list.d/pgdg.list && + curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg + + - run: apt update && apt -y --no-install-recommends install postgresql-server-dev-all + + - uses: actions/checkout@v4 + + - name: generate debian/control + run: pg_buildext updatecontrol && make -f debian/rules debian/control + + - name: install build deps + run: apt -y --no-install-recommends build-dep . + + - name: build package + run: make deb + + - name: mv *.deb to the cwd + run: mv ../*.deb . + + - uses: actions/upload-artifact@v4 with: - name: pkg + name: deb13-pkg + path: '*.deb' + retention-days: 1 - uses: yeti-switch/upload-debian-pkg-action@v2 with: pkgs: '*.deb' gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} + s3_component: trixie s3_access_key_id: ${{ secrets.DEB_AWS_ACCESS_KEY_ID }} s3_secret_access_key: ${{ secrets.DEB_AWS_SECRET_ACCESS_KEY }} s3_endpoint_url: ${{ secrets.DEB_AWS_ENDPOINT }} diff --git a/ci/bookworm-build.Dockerfile b/ci/bookworm-build.Dockerfile deleted file mode 100644 index c21d817..0000000 --- a/ci/bookworm-build.Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM debian:bookworm - -ENV DEBIAN_FRONTEND=noninteractive \ - LANG=C.UTF-8 - -ADD https://www.postgresql.org/media/keys/ACCC4CF8.asc /etc/apt/trusted.gpg.d/postgres.asc - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" >> /etc/apt/sources.list && \ - chmod 644 /etc/apt/trusted.gpg.d/*.asc - -COPY debian/control debian/control - -RUN apt update && \ - apt -y --no-install-recommends build-dep . && \ - rm -r debian/ - -ADD https://dl.google.com/dl/linux/direct/google-chrome-stable_current_amd64.deb . - -RUN apt install -y ./google-chrome-stable_current_amd64.deb && \ - google-chrome-stable --version && \ - rm -v google-chrome-stable_current_amd64.deb && \ - apt clean && rm -rf /var/lib/apt/lists/* - diff --git a/ci/bullseye-build.Dockerfile b/ci/bullseye-build.Dockerfile deleted file mode 100644 index 0b453c0..0000000 --- a/ci/bullseye-build.Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM debian:bullseye-slim - -ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 - -ADD https://www.postgresql.org/media/keys/ACCC4CF8.asc /etc/apt/trusted.gpg.d/postgres.asc - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" >> /etc/apt/sources.list && \ - chmod 644 /etc/apt/trusted.gpg.d/*.asc - -RUN apt update && \ - apt -y --no-install-recommends install postgresql-common - -COPY debian/control.in debian/control.in -COPY debian/pgversions debian/pgversions - -RUN pg_buildext updatecontrol - -RUN apt update && \ - apt -y --no-install-recommends build-dep . && \ - rm -r debian/ - diff --git a/ci/deploy.sh b/ci/deploy.sh deleted file mode 100755 index 4b4dc1f..0000000 --- a/ci/deploy.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -set -e - -release="$1" -shift -distr="$1" -shift -component="$1" -shift - -files="$@" -repo="${release}_${distr}_${component}" -timestamp="$(date +%s)" -dir="${repo}_${timestamp}" - -function fail { - echo "$1" - exit 1 -} - -for file in $files; do - echo -e "\n\e[33m> upload pkg \e[39m $file" - curl -sSfF file=@"$file" "${PKG_API_BASE}/files/$dir" || fail "can't upload pkg file $file" -done - -echo -e "\n\e[33m> add pkg to repo $repo\e[39m" -curl -sSf -X POST "${PKG_API_BASE}/repos/$repo/file/$dir" || fail "can't add pkg to repo" - -echo -e "\n\e[33m> update publish $release/$distr \e[39m" -curl -sSf -X PUT -H 'Content-Type: application/json' --data '{ "Signing": {"PassphraseFile":"/home/pkg/gpg_pass"} }' "${PKG_API_BASE}/publish/${release}/${distr}" || fail "can't publish"