Skip to content

Commit

Permalink
Automatically build deb package on a new version tag (#801)
Browse files Browse the repository at this point in the history
In #796, I noticed that the deb package was not build since an automation was missing.

With this PR, I add the missing automation.

I tested the workflow in my repo...

    when starting the workflow manually: https://github.com/MrSerth/pgcat/actions/runs/10737879151/job/29780286094
    when drafting a new release: https://github.com/MrSerth/pgcat/actions/runs/10737835796/job/29780146212

Obviously, both workflows failed since I cannot upload to the APT repo. However, the version substitution for the workflow is working correctly (as shown when collapsing the first line of the "Build and release package" step).
  • Loading branch information
MrSerth authored Sep 6, 2024
1 parent 88b2afb commit 9bb71ed
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/publish-deb-package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: pgcat package (deb)

on:
push:
tags:
- v*
workflow_dispatch:
inputs:
packageVersion:
Expand All @@ -16,6 +19,14 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set package version
if: github.event_name == 'push' # For push event
run: |
TAG=${{ github.ref_name }}
echo "packageVersion=${TAG#v}" >> "$GITHUB_ENV"
- name: Set package version (manual dispatch)
if: github.event_name == 'workflow_dispatch' # For manual dispatch
run: echo "packageVersion=${{ github.event.inputs.packageVersion }}" >> "$GITHUB_ENV"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand All @@ -39,10 +50,10 @@ jobs:
export ARCH=arm64
fi
bash utilities/deb.sh ${{ inputs.packageVersion }}
bash utilities/deb.sh ${{ env.packageVersion }}
deb-s3 upload \
--lock \
--bucket apt.postgresml.org \
pgcat-${{ inputs.packageVersion }}-ubuntu22.04-${ARCH}.deb \
pgcat-${{ env.packageVersion }}-ubuntu22.04-${ARCH}.deb \
--codename $(lsb_release -cs)

0 comments on commit 9bb71ed

Please sign in to comment.