Skip to content

Develop an automated workflow for upgrading the Homebrew Proton binary version. #360

@yokofly

Description

@yokofly

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:

  1. upgrade version
  2. update sha256 value
  3. 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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions