Deb packager #55
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deb packager | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag' | |
required: true | |
default: '' | |
TAG_GIT_REF: | |
description: 'Tag git Ref (leave empty for same as Tag)' | |
required: false | |
default: '' | |
jobs: | |
packager: | |
runs-on: ${{ matrix.platform.runs_on }} | |
strategy: | |
fail-fast: false | |
matrix: | |
pg: | |
- major: 13 | |
minor: 16 | |
- major: 14 | |
minor: 13 | |
- major: 15 | |
minor: 7 | |
- major: 16 | |
minor: 3 | |
- major: 17 | |
minor: 0 | |
platform: | |
- type: amd64 | |
runs_on: ubuntu-latest | |
- type: arm64 | |
runs_on: cloud-image-runner-arm64 | |
env: | |
PG_SRC_DIR: pgbuild | |
PG_INSTALL_DIR: postgresql | |
MAKE_JOBS: 6 | |
PG_CONFIG_PATH: postgresql/bin/pg_config | |
TAG: ${{ github.event.inputs.tag }} | |
TAG_DIR: pgvectorscale | |
TAG_GIT_REF: ${{ github.event.inputs.TAG_GIT_REF == '' && github.event.inputs.tag || github.event.inputs.TAG_GIT_REF}} | |
steps: | |
- name: Install package_cloud | |
run: | | |
sudo apt-get -qq update | |
sudo apt-get -qq install gcc g++ make ruby-all-dev | |
sudo gem install rake --no-doc | |
sudo gem install rainbow -v 2.2.2 --no-doc | |
sudo gem install package_cloud --no-doc | |
- name: Checkout pgvectorscale | |
uses: actions/checkout@v4 | |
- name: Install Linux Packages | |
uses: ./.github/actions/install-packages | |
- name: Install Deb builder specific packages | |
run: | | |
sudo apt-get install dpkg-dev debhelper build-essential | |
- name: Install PostgreSQL ${{ matrix.pg.major }} | |
uses: ./.github/actions/install-postgres | |
with: | |
pg-version: ${{ matrix.pg.major }}.${{ matrix.pg.minor }} | |
pg-src-dir: ~/${{ env.PG_SRC_DIR }} | |
pg-install-dir: ~/${{ env.PG_INSTALL_DIR }} | |
- name: Checkout ${{ env.TAG }} | |
uses: actions/checkout@v4 | |
with: | |
repository: timescale/pgvectorscale | |
ref: '${{ env.TAG_GIT_REF }}' | |
path: ${{ env.TAG_DIR }} | |
- name: Install pgrx | |
uses: ./.github/actions/install-pgrx | |
with: | |
pg-install-dir: ~/${{ env.PG_INSTALL_DIR }} | |
pgrx-version: 0.12.5 | |
- name: Build Deb | |
id: debbuild | |
run: | | |
export PATH=~/${{ env.PG_INSTALL_DIR }}/bin:$PATH | |
(cd ${{ env.TAG_DIR }} && make package) | |
bash scripts/package-deb.sh "${{ env.TAG }}" "${PWD}/${{ env.TAG_DIR }}" "$RUNNER_OS" "${{ matrix.pg.major }}" | |
# Use a GH artifact, then we can make use of the (quite limited) GH API https://docs.github.com/en/rest/actions/artifacts | |
# The artifact will have a TTL of 90 days | |
- name: Upload deb as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pgvectorscale-${{ env.TAG }}-pg${{ matrix.pg.major }}-${{ matrix.platform.type }} | |
path: pkgdump/pgvectorscale-*${{ env.TAG }}*.deb | |
- name: Upload to packagecloud | |
env: | |
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }} | |
run: | | |
source /etc/os-release | |
package_cloud push timescale/timescaledb/$VERSION_ID/$VERSION_CODENAME pkgdump/pgvectorscale-*${{ env.TAG }}*.deb |