Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 83 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,89 @@ jobs:
name: pgschema-${{ matrix.target }}
path: pgschema-${{ matrix.target }}

release:
packages:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Read version
id: version
run: echo "version=$(cat internal/version/VERSION)" >> $GITHUB_OUTPUT

- name: Download Linux AMD64 binary
uses: actions/download-artifact@v4
with:
name: pgschema-linux-amd64
path: ./dist

- name: Install nfpm
run: |
echo "deb [trusted=yes] https://repo.goreleaser.com/apt/ /" | sudo tee /etc/apt/sources.list.d/goreleaser.list
Copy link

Copilot AI Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using [trusted=yes] bypasses GPG verification for the repository, which poses a security risk. Consider adding the GPG key verification or using the official installation method.

Suggested change
echo "deb [trusted=yes] https://repo.goreleaser.com/apt/ /" | sudo tee /etc/apt/sources.list.d/goreleaser.list
curl -fsSL https://repo.goreleaser.com/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/goreleaser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/goreleaser-archive-keyring.gpg] https://repo.goreleaser.com/apt/ /" | sudo tee /etc/apt/sources.list.d/goreleaser.list

Copilot uses AI. Check for mistakes.
sudo apt-get update
sudo apt-get install -y nfpm

- name: Prepare binary
run: |
chmod +x ./dist/pgschema-linux-amd64
mkdir -p ./package/usr/bin
cp ./dist/pgschema-linux-amd64 ./package/usr/bin/pgschema
mkdir -p ./package/usr/share/doc/pgschema
cp LICENSE ./package/usr/share/doc/pgschema/

- name: Create nfpm config
run: |
cat > nfpm.yaml <<EOF
name: pgschema
arch: amd64
platform: linux
version: ${{ steps.version.outputs.version }}
section: database
priority: optional
maintainer: Bytebase <support@bytebase.com>
description: |
PostgreSQL declarative schema migration tool.
Think of it as Terraform for your Postgres schemas - declare your desired state,
generate plan, preview changes, and apply them with confidence.
vendor: Bytebase
homepage: https://www.pgschema.com
license: Apache-2.0
contents:
- src: ./package/usr/bin/pgschema
dst: /usr/bin/pgschema
file_info:
mode: 0755
- src: ./package/usr/share/doc/pgschema/LICENSE
dst: /usr/share/doc/pgschema/LICENSE
file_info:
mode: 0644
rpm:
group: Applications/Databases
summary: PostgreSQL declarative schema migration tool
EOF

- name: Build DEB package
run: nfpm package --packager deb --target ./dist/

- name: Build RPM package
run: nfpm package --packager rpm --target ./dist/

- name: Upload DEB package
uses: actions/upload-artifact@v4
with:
name: pgschema-deb
path: ./dist/*.deb

- name: Upload RPM package
uses: actions/upload-artifact@v4
with:
name: pgschema-rpm
path: ./dist/*.rpm

release:
needs: [build, packages]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -111,6 +191,8 @@ jobs:
binaries/pgschema-linux-arm64/pgschema-linux-arm64
binaries/pgschema-darwin-amd64/pgschema-darwin-amd64
binaries/pgschema-darwin-arm64/pgschema-darwin-arm64
binaries/pgschema-deb/*.deb
binaries/pgschema-rpm/*.rpm
Comment on lines +194 to +195
Copy link

Copilot AI Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The artifact paths reference 'binaries/' directory but the packages job uploads artifacts with names 'pgschema-deb' and 'pgschema-rpm'. The correct paths should be 'pgschema-deb/.deb' and 'pgschema-rpm/.rpm'.

Copilot uses AI. Check for mistakes.

docker:
needs: release
Expand Down