-
Notifications
You must be signed in to change notification settings - Fork 95
Description
Describe what enhancement you'd like to have
Currently, we have to manually upgrade homebrew version, this ticket is going to create an automatic GitHub action workflow.
detail logic:
i intend to split a new workflow, and the trigger only happens when we push a new tag or published event
on:
push:
tags:
- 'v*'
or try release event:
try below you can run a workflow when a release has been published.
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
on:
release:
types: [published]
jobs: use notify
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch
actually, the homebrew only does 3 things:
- upgrade version
- update sha256 value
- add a soft link in formula alias.
so basically the things can be:
proton will export the sha256sum(prefer) or we download the proton binary and calculate and redirect to homebrew workflow.
below is draft by gpt:)
proton repo:
name: Notify Homebrew Repo
on:
release:
types: [published]
jobs:
notify-homebrew-repo:
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
repository: timeplus-io/homebrew-timeplus
event-type: new-version
client-payload: '{"version": "${{ github.event.release.tag_name }}", "sha256": "your_sha256_value_here"}'
homebrew repo:
name: Update Homebrew Formula on Repository Dispatch
on:
repository_dispatch:
types: [new-version]
jobs:
update-formula:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Update Homebrew formula
run: |
VERSION=${{ github.event.client_payload.version }}
SHA256=${{ github.event.client_payload.sha256 }}
sed -i "s/version \".*\"/version \"$VERSION\"/" Formula/proton@1.3.24.rb
sed -i "s/sha256 \".*\"/sha256 \"$SHA256\"/" Formula/proton@1.3.24.rb
git commit -am "Update to version $VERSION"
git push