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

[F] Fix GitHub Actions trigger issues. #101

Merged
merged 1 commit into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
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
28 changes: 28 additions & 0 deletions .github/workflows/post-release-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release
on:
release:
types: [released]

name: Update Homebrew cask

jobs:
homebrew-pr:
runs-on: macos-10.15
steps:
- name: Set $VERSION without preifx v
# https://hub.apw.appmunity/t/how-to-get-just-the-tag-name/16241
# https://stackoverflow.com/questions/57968497/how-do-i-set-an-env-var-with-a-bash-expression-in-github-actions
run: echo VERSION=$(echo ${GITHUB_REF##*/} | cut -c2-) >> $GITHUB_ENV

- name: Install Homebrew
# Command from https://brew.sh/
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# https://github.com/Homebrew/homebrew-cask/blob/master/CONTRIBUTING.md#updating-a-cask
- name: Updating cask Deskreen
run: brew bump-cask-pr --version $VERSION deskreen
env:
# First, create a personal access token: (url from Homebrew's output)
# https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
# Then, go repo settings -> Secrets -> New repository secret -> HOMEBREW_GITHUB_API_TOKEN : <secret value>.
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
21 changes: 0 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,3 @@ jobs:
file: ${{ matrix.artifact_name }}
tags: true
draft: true

homebrew-pr:
runs-on: macos-10.15
steps:
- name: Set $VERSION without preifx v
# https://hub.apw.appmunity/t/how-to-get-just-the-tag-name/16241
# https://stackoverflow.com/questions/57968497/how-do-i-set-an-env-var-with-a-bash-expression-in-github-actions
run: echo VERSION=$(echo ${GITHUB_REF##*/} | cut -c2-) >> $GITHUB_ENV

- name: Install Homebrew
# Command from https://brew.sh/
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# https://github.com/Homebrew/homebrew-cask/blob/master/CONTRIBUTING.md#updating-a-cask
- name: Updating cask Deskreen
run: brew bump-cask-pr --version $VERSION deskreen
env:
# First, create a personal access token: (url from Homebrew's output)
# https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
# Then, go repo settings -> Secrets -> New repository secret -> HOMEBREW_GITHUB_API_TOKEN : <secret value>.
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}