2023-01-15 17:27:41 +01:00
|
|
|
name: "Publish Homebrew Cask on Release"
|
2021-10-24 16:00:10 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
# Should match semver for mainline releases (not including -beta)
|
2023-01-15 17:27:41 +01:00
|
|
|
- "v2.[0-9]+.[0-9]+"
|
2021-10-24 16:00:10 +02:00
|
|
|
# TODO: handle beta and nightly releases
|
|
|
|
# Need to make those casks manually first
|
|
|
|
# - v2.[0-9]+.[0-9]+-beta(?:[0-9]+)
|
|
|
|
|
|
|
|
env:
|
|
|
|
# This gets updated later on in the run by a bash script to strip the prefix
|
2022-11-29 11:12:44 +01:00
|
|
|
C2_CASK_NAME: chatterino
|
2023-02-19 17:08:32 +01:00
|
|
|
# The full version of Chatterino (e.g. v2.4.1)
|
2022-11-29 11:12:44 +01:00
|
|
|
C2_TAGGED_VERSION: ${{ github.ref_name }}
|
|
|
|
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
2021-10-24 16:00:10 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
update_stable_homebrew_cask:
|
2023-01-15 17:27:41 +01:00
|
|
|
name: "Update the stable homebrew cask"
|
|
|
|
runs-on: "macos-latest"
|
2021-10-24 16:00:10 +02:00
|
|
|
steps:
|
|
|
|
# Pulls out the version from the ref (e.g. refs/tags/v2.3.1 -> 2.3.1)
|
2022-11-29 11:12:44 +01:00
|
|
|
- name: Execute brew bump-cask-pr with version
|
2021-10-24 16:00:10 +02:00
|
|
|
run: |
|
2022-11-29 11:12:44 +01:00
|
|
|
echo "Running bump-cask-pr for cask '$C2_CASK_NAME' and version '$C2_TAGGED_VERSION'"
|
2023-02-19 17:08:32 +01:00
|
|
|
C2_TAGGED_VERSION_STRIPPED="${C2_TAGGED_VERSION:1}"
|
|
|
|
echo "Stripped version: '$C2_TAGGED_VERSION_STRIPPED'"
|
2024-04-22 07:07:35 +02:00
|
|
|
brew developer on
|
2023-02-19 17:08:32 +01:00
|
|
|
brew bump-cask-pr --version "$C2_TAGGED_VERSION_STRIPPED" "$C2_CASK_NAME"
|