postgres.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. name: postgres
  2. on:
  3. push:
  4. paths:
  5. - '.github/workflows/postgres.yml'
  6. workflow_dispatch:
  7. env:
  8. ALPINE_VER: 3.21
  9. jobs:
  10. job1:
  11. name: buildx tag
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Checkout
  15. uses: actions/checkout@v4
  16. - name: download postgres src
  17. run: |
  18. sudo apt-get update
  19. sudo apt-get install git
  20. git clone https://github.com/docker-library/postgres.git
  21. sed -i 's/llvm19/llvm15/g' postgres/14/alpine3.21/Dockerfile
  22. sed -i 's/clang19/clang15/g' postgres/14/alpine3.21/Dockerfile
  23. sed -i 's/clang-19/clang-15/g' postgres/14/alpine3.21/Dockerfile
  24. sed -i 's/coreutils/coreutils patch/g' postgres/14/alpine3.21/Dockerfile
  25. sed -i 's/^ENV.*PG_VERSION.*/ENV PG_VERSION 14.1/g' postgres/14/alpine3.21/Dockerfile
  26. sed -i 's/^ENV.*PG_SHA256.*/ENV PG_SHA256 4d3c101ea7ae38982f06bdc73758b53727fb6402ecd9382006fa5ecc7c2ca41f/g' postgres/14/alpine3.21/Dockerfile
  27. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < postgresql-14-xml-2.12.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  28. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/postgresql-14-xml-2.12.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  29. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < postgresql.git-99e4d24a9d77e7bb87e15b318e96dc36651a7da2.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  30. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/postgresql.git-99e4d24a9d77e7bb87e15b318e96dc36651a7da2.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  31. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < v1-0001-WIP-jit-LLVM-15-Minimal-changes.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  32. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/v1-0001-WIP-jit-LLVM-15-Minimal-changes.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  33. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < postgresql.git-0052fb489008a68d0f3e0445f52e1ab3166632a4.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  34. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/postgresql.git-0052fb489008a68d0f3e0445f52e1ab3166632a4.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  35. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < llvm14-support.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  36. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/llvm14-support.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  37. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < 0001-Replace-uses-of-deprecated-Python-module-distutils.s.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  38. sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/0001-Replace-uses-of-deprecated-Python-module-distutils.s.patch; \\ ' postgres/14/alpine3.21/Dockerfile
  39. - name: Set up QEMU
  40. id: qemu
  41. uses: docker/setup-qemu-action@v3
  42. with:
  43. platforms: all
  44. - name: Set up Docker Buildx
  45. id: buildx
  46. uses: docker/setup-buildx-action@v3
  47. with:
  48. version: latest
  49. - name: Login to GHCR
  50. uses: docker/login-action@v3
  51. with:
  52. registry: ghcr.io
  53. username: ${{ github.actor }}
  54. password: ${{ secrets.GITHUB_TOKEN }}
  55. - name: Build and push
  56. uses: docker/build-push-action@v6
  57. with:
  58. context: ./postgres/14/alpine3.21
  59. file: ./postgres/14/alpine3.21/Dockerfile
  60. platforms: linux/amd64,linux/arm64,linux/arm/v7
  61. push: true
  62. tags: |
  63. ghcr.io/gshang2017/postgres:latest
  64. ghcr.io/gshang2017/postgres:14.1-alpine-${{ env.ALPINE_VER }}