Skip to content

Update Homebrew Tap #18

Update Homebrew Tap

Update Homebrew Tap #18

Workflow file for this run

name: Update Homebrew Tap
on:
release:
types:
- published
workflow_dispatch:
jobs:
update-homebrew-cask:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses:
actions/checkout@v4
- name: Download Latest Release File
id: download_files
uses: robinraju/release-downloader@v1.9
with:
latest: true
preRelease: true
fileName: "*.dmg"
tarBall: false
zipBall: false
out-file-path: "downloads"
- name: Generate Checksums
uses: jmgilman/actions-generate-checksum@v1.0.1
with:
patterns: |
downloads/*.dmg
method: sha256
output: checksums.txt
- name: Get Checksum
id: get_checksum
run: echo "checksum=$(cat ${{ github.workspace }}/checksums.txt)" >> $GITHUB_OUTPUT
- name: Echo Checksum
run: echo ${{ steps.get_checksum.outputs.checksum }}
- name: Extract Checksum From Checksum File Content
uses: tmelliottjr/extract-regex-action@v1.4.0
id: extract_checksum
with:
regex: '^\w+'
flags: "sm"
input: ${{ steps.get_checksum.outputs.checksum }}
- name: Find and Replace sha256 In Cask File
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "Casks/pikachuexe-freetube.rb"
find: 'sha256 \"\w+\"'
replace: 'sha256 \"${{ steps.extract_checksum.outputs.resultString }}\"'
regex: true
- name: Upload Updated Cask File
uses: actions/upload-artifact@v4
with:
name: Cask File
path: "Casks/pikachuexe-freetube.rb"
# Minimum artifact retention is 1 day
retention-days: 1
compression-level: 0