Release v0.21.3 Beta #46
Workflow file for this run
This file contains hidden or 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 | |
env: | |
TAP: "pikachuexe/freetube" | |
CASK: "pikachuexe-freetube" | |
steps: | |
- name: Checkout Repository | |
uses: | |
actions/checkout@v4 | |
- name: Download Latest Release File | |
id: download_files | |
uses: robinraju/[email protected] | |
with: | |
latest: true | |
preRelease: true | |
fileName: "*.dmg" | |
tarBall: false | |
zipBall: false | |
out-file-path: "downloads" | |
- name: Generate Checksums | |
uses: jmgilman/[email protected] | |
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/[email protected] | |
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/[email protected] | |
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: Get Token | |
id: get_workflow_token | |
uses: peter-murray/workflow-application-token-action@v3 | |
with: | |
application_id: ${{ secrets.APPLICATION_ID }} | |
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }} | |
revoke_token: true | |
permissions: "contents:write, metadata:read, pull_requests:write" | |
- name: Create Pull Request | |
id: create-pr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: "${{ steps.get_workflow_token.outputs.token }}" | |
commit-message: '[create-pull-request] Update Cask' | |
branch: "update/cask/${{ steps.download_files.outputs.tag_name }}" | |
base: master | |
delete-branch: true | |
title: 'Update Cask' | |
body: | | |
Updated info in Cask file from [latest release (`${{ steps.download_files.outputs.tag_name }}`)](https://github.com/PikachuEXE/homebrew-FreeTube/releases/tag/${{ steps.download_files.outputs.tag_name }}) | |
[cpr]: | |
https://github.com/peter-evans/create-pull-request | |
(https://github.com/peter-evans/create-pull-request) | |
labels: | | |
cask-update | |
automated pr | |
add-paths: | | |
Casks/pikachuexe-freetube.rb |