-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup automatic release deployment #12
Labels
enhancement
New feature or request
Comments
jnsahaj
added
enhancement
New feature or request
good first issue
Good for newcomers
and removed
good first issue
Good for newcomers
labels
Nov 9, 2024
I've done something similar to my own project I'm using GitHub workflows to automate the changes to be done on the homebrew tap repo using this script: name: Update Homebrew Tap
on:
push:
tags:
- 'v*'
workflow_dispatch: # allow manual trigger
jobs:
update-tap:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set release version from tag
run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Download release artifact
run: wget https://github.com/jmattaa/laser/archive/${RELEASE_VERSION}.tar.gz -O laser-${RELEASE_VERSION}.tar.gz
- name: Calculate SHA256 checksum
id: sha256
run: echo "SHA256=$(sha256sum laser-${RELEASE_VERSION}.tar.gz | awk '{print $1}')" >> $GITHUB_ENV
- name: Clone the Homebrew Tap repository
run: |
git clone https://github.com/jmattaa/homebrew-laser.git
cd homebrew-laser
git checkout main
- name: Update laser.rb formula
run: |
cd homebrew-laser
sed -i.bak "s|^ url .*| url \"https://github.com/jmattaa/laser/archive/${RELEASE_VERSION}.tar.gz\"|" laser.rb
sed -i.bak "s|^ sha256 .*| sha256 \"${SHA256}\"|" laser.rb
sed -i.bak "s|^ version .*| version \"${RELEASE_VERSION}\"|" laser.rb
- name: Commit and push changes to the Homebrew Tap
run: |
cd homebrew-laser
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.PAT }}@github.com/jmattaa/homebrew-laser.git
git add laser.rb
git commit -m "chore: update laser.rb for ${RELEASE_VERSION}"
git push origin main |
This is fantastic! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The process of deploying a release on homebrew is the following
Upload the release binary under a new release on Github
# generate shasum to be used for homebrew shasum -a 256 lumen.tar.gz
Inside
jnsahaj/homebrew-lumen
After homebrew deployment, need to deploy new version to cargo
Cargo.toml
versionCargo.toml
andCargo.lock
filescargo publish
The text was updated successfully, but these errors were encountered: