Update Homebrew Tap #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "" | |
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: Extract Version From Release | |
uses: tmelliottjr/extract-regex-action@v1.4.0 | |
id: extract_version | |
with: | |
regex: '\d+(\.\d+)+' | |
flags: "" | |
input: ${{ steps.download_files.outputs.tag_name }} | |
- name: Find and Replace version In Cask File | |
uses: jacobtomlinson/gha-find-replace@v3 | |
with: | |
include: "Casks/pikachuexe-freetube.rb" | |
find: 'version "\d+(\.\d+)+"' | |
replace: 'version "${{ fromJson(steps.extract_version.outputs.resultArray)[0] }}"' | |
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 |