|
32 | 32 | matrix: |
33 | 33 | extension_name: |
34 | 34 | - supautils |
35 | | - postgres: [13, 14, 15, 16, 17] |
| 35 | + postgres: [14, 15, 16, 17] |
36 | 36 | box: |
37 | | - - { runner: ubuntu-latest, arch: amd64 } |
38 | | - - { runner: ubuntu-24.04-arm, arch: arm64 } |
| 37 | + - { runner: ubuntu-22.04-arm, arch: arm64 } |
39 | 38 | runs-on: ${{ matrix.box.runner }} |
40 | 39 | steps: |
41 | 40 | - uses: actions/checkout@v3 |
|
60 | 59 | # Build supautils |
61 | 60 | make |
62 | 61 |
|
63 | | - # name of the package directory before packaging |
64 | | - package_dir=${{ matrix.extension_name }}-${{ github.ref_name }}-pg${{ matrix.postgres }}-${{ matrix.box.arch }}-linux-gnu |
65 | | -
|
66 | | - # Copy files into directory structure |
67 | | - mkdir -p ${package_dir}/usr/lib/postgresql/lib |
68 | | - mkdir -p ${package_dir}/var/lib/postgresql/extension |
69 | | - cp *.so ${package_dir}/usr/lib/postgresql/lib |
70 | | -
|
71 | | - # symlinks to Copy files into directory structure |
72 | | - mkdir -p ${package_dir}/usr/lib/postgresql/${{ matrix.postgres }}/lib |
73 | | - cd ${package_dir}/usr/lib/postgresql/${{ matrix.postgres }}/lib |
74 | | - cp -s ../../lib/*.so . |
75 | | - cd ../../../../../.. |
76 | | -
|
77 | | - mkdir -p ${package_dir}/usr/share/postgresql/${{ matrix.postgres }}/extension |
78 | | - cd ${package_dir}/usr/share/postgresql/${{ matrix.postgres }}/extension |
79 | | - cd ../../../../../.. |
80 | | -
|
81 | | - # Create install control file |
82 | | - extension_version=${{ github.ref_name }} |
83 | | - # strip the leading v |
84 | | - deb_version=${extension_version:1} |
85 | | -
|
86 | | - mkdir -p ${package_dir}/DEBIAN |
87 | | - touch ${package_dir}/DEBIAN/control |
88 | | - echo 'Package: ${{ matrix.extension_name }}' >> ${package_dir}/DEBIAN/control |
89 | | - echo 'Version:' ${deb_version} >> ${package_dir}/DEBIAN/control |
90 | | - echo 'Architecture: ${{ matrix.box.arch }}' >> ${package_dir}/DEBIAN/control |
91 | | - echo 'Maintainer: supabase' >> ${package_dir}/DEBIAN/control |
92 | | - echo 'Description: A PostgreSQL extension' >> ${package_dir}/DEBIAN/control |
93 | | -
|
94 | | - # Create deb package |
95 | | - sudo chown -R root:root ${package_dir} |
96 | | - sudo chmod -R 00755 ${package_dir} |
97 | | - sudo dpkg-deb --build --root-owner-group ${package_dir} |
98 | | -
|
99 | 62 | - name: Get upload url |
100 | 63 | run: echo UPLOAD_URL=$(curl --silent https://api.github.com/repos/${{ github.repository }}/releases/latest | jq .upload_url --raw-output) >> $GITHUB_ENV |
101 | 64 |
|
|
105 | 68 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
106 | 69 | with: |
107 | 70 | upload_url: ${{ needs.release.outputs.upload_url }} |
108 | | - asset_path: ./${{ matrix.extension_name }}-${{ github.ref_name }}-pg${{ matrix.postgres }}-${{ matrix.box.arch }}-linux-gnu.deb |
109 | | - asset_name: ${{ matrix.extension_name }}-${{ github.ref_name }}-pg${{ matrix.postgres }}-${{ matrix.box.arch }}-linux-gnu.deb |
110 | | - asset_content_type: application/vnd.debian.binary-package |
| 71 | + asset_path: ./${{ matrix.extension_name }}.so |
| 72 | + asset_name: ${{ matrix.extension_name }}-${{ github.ref_name }}-pg${{ matrix.postgres }}-${{ matrix.box.arch }}-linux-gnu.so |
| 73 | + asset_content_type: application/octet-stream |
111 | 74 |
|
112 | 75 | - name: Configure aws credentials for uploading release artifacts |
113 | 76 | if: ${{ matrix.box.arch == 'arm64' }} |
|
119 | 82 | - name: Upload release artifacts to S3 |
120 | 83 | if: ${{ matrix.box.arch == 'arm64' }} |
121 | 84 | run: | |
122 | | - aws s3api put-object --bucket ${{ secrets.PROD_ARTIFACTS_BUCKET }} --key extensions/${{ matrix.extension_name }}-${{ github.ref_name }}-pg${{ matrix.postgres }}-${{ matrix.box.arch }}-linux-gnu.deb --body ./${{ matrix.extension_name }}-${{ github.ref_name }}-pg${{ matrix.postgres }}-${{ matrix.box.arch }}-linux-gnu.deb |
| 85 | + aws s3api put-object --bucket ${{ secrets.PROD_ARTIFACTS_BUCKET }} --key extensions/${{ matrix.extension_name }}-${{ github.ref_name }}-pg${{ matrix.postgres }}-${{ matrix.box.arch }}-linux-gnu.so --body ./${{ matrix.extension_name }}.so |
0 commit comments