-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (71 loc) · 2.34 KB
/
update-tap.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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