Skip to content

Commit 235bc09

Browse files
authored
Merge pull request #114 from mjcheetham/github-actions
homebrew: publish new package version on release
2 parents 1e0361a + 4529dd2 commit 235bc09

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "release-homebrew"
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Get macOS package version
11+
uses: actions/[email protected]
12+
id: version
13+
with:
14+
result-encoding: string
15+
script: |
16+
const { data } = await github.repos.getReleaseByTag({
17+
owner: context.repo.owner,
18+
repo: context.repo.repo,
19+
tag: process.env.GITHUB_REF
20+
});
21+
const regex = /gcmcore-osx-(.*)\.pkg/;
22+
const asset = data.assets.find(x => regex.test(x.name));
23+
const matches = asset.name.match(regex);
24+
const version = matches[1];
25+
return version;
26+
- name: Update Homebrew tap
27+
uses: mjcheetham/update-homebrew@v1
28+
with:
29+
token: ${{ secrets.HOMEBREW_TOKEN }}
30+
tap: microsoft/git
31+
name: git-credential-manager-core
32+
type: cask
33+
version: ${{ steps.version.outputs.result }}

0 commit comments

Comments
 (0)