Skip to content

Comments

chore: add brew#77

Merged
tianzhou merged 1 commit intomainfrom
brew
Oct 13, 2025
Merged

chore: add brew#77
tianzhou merged 1 commit intomainfrom
brew

Conversation

@tianzhou
Copy link
Contributor

For #74

Copilot AI review requested due to automatic review settings October 13, 2025 11:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Homebrew package distribution support to the release workflow, enabling automatic formula updates for macOS users when new releases are published.

  • Introduces a new homebrew job that runs after the main release job completes
  • Downloads the Darwin ARM64 binary and calculates its SHA256 hash for the Homebrew formula
  • Uses the mislav/bump-homebrew-formula-action to automatically update the formula in the pgschema/homebrew-pgschema tap

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 285 to 297
- name: Calculate SHA256
id: sha256
run: |
SHA256=$(shasum -a 256 ./dist/pgschema-darwin-arm64 | cut -d ' ' -f 1)
echo "sha256=${SHA256}" >> $GITHUB_OUTPUT

- name: Update Homebrew formula
uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: pgschema
formula-path: Formula/pgschema.rb
homebrew-tap: pgschema/homebrew-pgschema
download-url: https://github.com/pgschema/pgschema/releases/download/v${{ steps.version.outputs.version }}/pgschema-darwin-arm64
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

The download URL is hardcoded to only support Darwin ARM64 architecture. This limits Homebrew support to Apple Silicon Macs and excludes Intel-based Macs. Consider adding support for both architectures or using a universal binary.

Suggested change
- name: Calculate SHA256
id: sha256
run: |
SHA256=$(shasum -a 256 ./dist/pgschema-darwin-arm64 | cut -d ' ' -f 1)
echo "sha256=${SHA256}" >> $GITHUB_OUTPUT
- name: Update Homebrew formula
uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: pgschema
formula-path: Formula/pgschema.rb
homebrew-tap: pgschema/homebrew-pgschema
download-url: https://github.com/pgschema/pgschema/releases/download/v${{ steps.version.outputs.version }}/pgschema-darwin-arm64
- name: Download Darwin AMD64 binary
uses: actions/download-artifact@v4
with:
name: pgschema-darwin-amd64
path: ./dist
- name: Calculate SHA256 (ARM64)
id: sha256_arm64
run: |
SHA256=$(shasum -a 256 ./dist/pgschema-darwin-arm64 | cut -d ' ' -f 1)
echo "sha256=${SHA256}" >> $GITHUB_OUTPUT
- name: Calculate SHA256 (AMD64)
id: sha256_amd64
run: |
SHA256=$(shasum -a 256 ./dist/pgschema-darwin-amd64 | cut -d ' ' -f 1)
echo "sha256=${SHA256}" >> $GITHUB_OUTPUT
- name: Update Homebrew formula
uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: pgschema
formula-path: Formula/pgschema.rb
homebrew-tap: pgschema/homebrew-pgschema
download-url-arm64: https://github.com/pgschema/pgschema/releases/download/v${{ steps.version.outputs.version }}/pgschema-darwin-arm64
sha256-arm64: ${{ steps.sha256_arm64.outputs.sha256 }}
download-url-amd64: https://github.com/pgschema/pgschema/releases/download/v${{ steps.version.outputs.version }}/pgschema-darwin-amd64
sha256-amd64: ${{ steps.sha256_amd64.outputs.sha256 }}

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only apple silicon

Comment on lines 285 to 290
- name: Calculate SHA256
id: sha256
run: |
SHA256=$(shasum -a 256 ./dist/pgschema-darwin-arm64 | cut -d ' ' -f 1)
echo "sha256=${SHA256}" >> $GITHUB_OUTPUT

Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

The SHA256 calculation is computed but the sha256 output is not used in the homebrew formula update action. The action likely calculates the hash automatically from the download URL, making this step redundant.

Suggested change
- name: Calculate SHA256
id: sha256
run: |
SHA256=$(shasum -a 256 ./dist/pgschema-darwin-arm64 | cut -d ' ' -f 1)
echo "sha256=${SHA256}" >> $GITHUB_OUTPUT

Copilot uses AI. Check for mistakes.
@tianzhou tianzhou merged commit 0d545b1 into main Oct 13, 2025
2 checks passed
@tianzhou tianzhou deleted the brew branch October 23, 2025 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant