Skip to content
Closed
Show file tree
Hide file tree
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
60 changes: 60 additions & 0 deletions .github/workflows/homebrew-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "Update Homewbrew Cask"

on:
pull_request:
branches:
- main
types: closed
workflow_dispatch:
inputs:
ref:
description: 'Commit SHA to build'
required: true
default: 'main'
type: string

jobs:
build-and-update:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-22.04
steps:
- id: checkout-ref
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "ref=${{ github.event.inputs.ref }}" >> $GITHUB_OUTPUT
else
echo "ref=${{ github.event.pull_request.merge_commit_sha }}" >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v4
with:
ref: ${{ steps.checkout-ref.outputs.ref }}
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: goreleaser/goreleaser-action@v6
with:
args: release --snapshot --clean
- uses: aws-actions/configure-aws-credentials@v5
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- run: |
sha_hash=${{ steps.checkout-ref.outputs.ref }}
short_hash=${sha_hash:0:9}
for artifact in dist/super-${short_hash}*; do aws s3 cp $artifact s3://super-prereleases/${short_hash}/ ; done
- uses: actions/checkout@v4
with:
repository: brimdata/homebrew-tap
token: ${{ secrets.PAT_TOKEN }}
path: homebrew-tap
- run: |
mkdir -p homebrew-tap/Casks
cp dist/homebrew/Casks/super.rb homebrew-tap/Casks
cd homebrew-tap
git config --global user.name 'Brim Automation'
git config --global user.email '[email protected]'
git add Casks/super.rb
git commit -am "update super Homebrew Cask to ${{ steps.checkout-ref.outputs.ref }}" || true
git push
8 changes: 5 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ builds:
env:
- CGO_ENABLED=0
ldflags:
- -s -X github.com/brimdata/super/cli.version={{ .Tag }}
- -s -X github.com/brimdata/super/cli.version={{ .ShortCommit }}
goarch:
- amd64
- arm64
Expand All @@ -16,7 +16,7 @@ builds:
- windows
- darwin
archives:
- name_template: "{{ .ProjectName }}-{{ .Tag }}.{{ .Os }}-{{ .Arch }}"
- name_template: "{{ .ProjectName }}-{{ .ShortCommit }}.{{ .Os }}-{{ .Arch }}"
format_overrides:
- goos: windows
formats: [ "zip" ]
Expand All @@ -36,9 +36,11 @@ homebrew_casks:
homepage: https://github.com/brimdata/super
description: |
An analytics database that fuses structured and semi-structured data
url:
template: "https://super-prereleases.s3.us-east-2.amazonaws.com/{{ .ShortCommit }}/{{ .ArtifactName }}"
checksum:
name_template: 'super-checksums.txt'
snapshot:
version_template: "{{ incpatch .Version }}-{{ .ShortCommit }}"
version_template: "{{ .ShortCommit }}"
changelog:
disable: true