Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to auto update Homebrew Casks #411

Merged
merged 1 commit into from
Jul 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/homebrew-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Update Homebrew Tap
on:
release:
types: [released]
mjcheetham marked this conversation as resolved.
Show resolved Hide resolved

jobs:
release:
runs-on: ubuntu-latest
steps:
- id: version
name: Compute version number
run: |
echo "::set-output name=result::$(echo $GITHUB_REF | sed -e "s/^refs\/tags\/v//")"
- id: hash
name: Compute release asset hash
uses: mjcheetham/asset-hash@v1
with:
asset: Installers_macOS_Release.zip
hash: sha256
token: ${{ secrets.GITHUB_TOKEN }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This token is automatically created. It only has public read access to GitHub repos, which is all we need to compute the hash from a released Scalar asset.

- name: Update scalar Cask
uses: mjcheetham/update-homebrew@v1.1
with:
token: ${{ secrets.HOMEBREW_TOKEN }}
tap: microsoft/git
name: scalar
type: cask
version: ${{ steps.version.outputs.result }}
sha256: ${{ steps.hash.outputs.result }}
alwaysUsePullRequest: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly to the GCM Core workflow, we always create PRs rather than push a commit immediately to give us one more 'gate'.

- name: Update scalar-azrepos Cask
uses: mjcheetham/update-homebrew@v1.1
with:
token: ${{ secrets.HOMEBREW_TOKEN }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This token is a PAT (mine) has been added to the repository. The commits/PRs will be created as 'me'.
Would be nice if we had a 'service user' who we could use instead.

tap: microsoft/git
name: scalar-azrepos
type: cask
version: ${{ steps.version.outputs.result }}
sha256: ${{ steps.hash.outputs.result }}
alwaysUsePullRequest: true