ci: deploy: add 'gpg-agent' pkg #23
Workflow file for this run
This file contains 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: build/deploy | |
on: | |
pull_request: | |
push: | |
branches: | |
- "*" | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: debian:bookworm | |
steps: | |
- 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 bookworm-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@v3 | |
with: | |
name: pkg | |
path: '*.deb' | |
retention-days: 1 | |
deploy: | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
container: debian:bookworm | |
steps: | |
- name: install curl | |
run: apt update && apt -y --no-install-recommends install curl ca-certificates ruby gpg gpg-agent | |
- name: clone yeti-pg-ext repo for ci/deploy.sh | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: pkg | |
- name: upload pkg to the bookworm 1.13 | |
run: ci/deploy.sh bookworm 1.13 main *.deb | |
env: | |
PKG_API_BASE: ${{secrets.PKG_API_BASE}} | |
- name: Setup deb-s3 | |
run: gem install deb-s3 | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Upload package | |
env: | |
AWS_ACCESS_KEY_ID: ${{secrets.DEB_AWS_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.DEB_AWS_SECRET_ACCESS_KEY}} | |
AWS_ENDPOINT_URL: ${{secrets.DEB_AWS_ENDPOINT}} | |
run: deb-s3 upload --bucket=${{secrets.DEB_AWS_BUCKET}} --prefix=1.13 --codename=bookworm --component=main --visibility=nil --force-path-style --sign=B104E10C35895CFAC0F91473C8D3BC80B6F22179 --gpg-options "\-\-pinentry-mode=loopback \-\-no-tty \-\-batch \-\-yes \-\-passphrase ${{ secrets.GPG_PASSPHRASE }}" *.deb |