-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (59 loc) · 2.02 KB
/
brew.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
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag'
required: true
name: Manual Homebrew Push
jobs:
formula:
runs-on: ubuntu-latest
name: Push updated Homebrew formula
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Fetch checksum file
uses: dsaltares/fetch-gh-release-asset@master
with:
file: "checksum.txt"
target: "checksum.txt"
version: "tags/${{ github.event.inputs.tag }}"
- name: Fetch checksums
id: checksums
run: |
APPLE=$(cat checksum.txt | grep release/x86_64-apple-darwin.tar.gz | cut -d " " -f 1)
LINUX=$(cat checksum.txt | grep release/x86_64-unknown-linux-gnu.tar.gz | cut -d " " -f 1)
echo "::set-output name=sha256_apple::$APPLE"
echo "::set-output name=sha256_linux::$LINUX"
- name: Build formula
uses: cuchi/[email protected]
with:
template: ci/brew.rb.j2
output_file: vaultssh.rb
strict: true
variables: |
SHA256_APPLE=${{ steps.checksums.outputs.sha256_apple }}
SHA256_LINUX=${{ steps.checksums.outputs.sha256_linux }}
VERSION=${{ github.event.inputs.tag }}
- name: Encode formula with base64
id: encode
run: |
BASE64=$(base64 -w 0 vaultssh.rb)
echo "::set-output name=base64::$BASE64"
- name: Dispatch update to homebrew tap repository
uses: peter-evans/repository-dispatch@v1
with:
token: "${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}"
repository: jmgilman/homebrew-apps
event-type: update
client-payload: |
{
"content": "${{ steps.encode.outputs.base64 }}",
"name": "vaultssh",
"version": "${{ github.event.inputs.tag }}"
}
- name: Upload formula as artifact
uses: actions/upload-artifact@v2
with:
name: formula
path: vaultssh.rb