Sunshine/.github/workflows/update-homebrew-release.yml
dependabot[bot] 443be5d403
build(deps): bump LizardByte/homebrew-release-action from 2024.609.4731 to 2024.612.21058 (#2677)
build(deps): bump LizardByte/homebrew-release-action

Bumps [LizardByte/homebrew-release-action](https://github.com/lizardbyte/homebrew-release-action) from 2024.609.4731 to 2024.612.21058.
- [Release notes](https://github.com/lizardbyte/homebrew-release-action/releases)
- [Commits](https://github.com/lizardbyte/homebrew-release-action/compare/v2024.609.4731...v2024.612.21058)

---
updated-dependencies:
- dependency-name: LizardByte/homebrew-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-12 22:55:30 +00:00

72 lines
2.3 KiB
YAML

---
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
# If more Homebrew applications are developed, consider moving this action to the organization's .github repository,
# using the `homebrew-pkg` repository label to identify repositories that should trigger have this workflow.
# Update Homebrew on release events.
name: Update Homebrew release
on:
release:
types: [created, edited]
concurrency:
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
cancel-in-progress: true
jobs:
update-homebrew-release:
if: >-
github.repository_owner == 'LizardByte' &&
!github.event.release.draft && !github.event.release.prerelease
runs-on: ubuntu-latest
steps:
- name: Check if Homebrew repo
env:
TOPIC: homebrew-pkg
id: check
uses: actions/github-script@v7
with:
script: |
const topic = process.env.TOPIC;
console.log(`Checking if repo has topic: ${topic}`);
const repoTopics = await github.rest.repos.getAllTopics({
owner: context.repo.owner,
repo: context.repo.repo
});
console.log(`Repo topics: ${repoTopics.data.names}`);
const hasTopic = repoTopics.data.names.includes(topic);
console.log(`Has topic: ${hasTopic}`);
core.setOutput('hasTopic', hasTopic);
- name: Download release asset
id: download
if: >-
steps.check.outputs.hasTopic == 'true'
uses: robinraju/release-downloader@v1.10
with:
repository: "${{ github.repository }}"
tag: "${{ github.event.release.tag_name }}"
fileName: "*.rb"
tarBall: false
zipBall: false
out-file-path: "release_downloads"
extract: false
- name: Publish Homebrew Formula
if: >-
steps.check.outputs.hasTopic == 'true' &&
fromJson(steps.download.outputs.downloaded_files)[0]
uses: LizardByte/homebrew-release-action@v2024.612.21058
with:
formula_file: ${{ fromJson(steps.download.outputs.downloaded_files)[0] }}
git_email: ${{ secrets.GH_BOT_EMAIL }}
git_username: ${{ secrets.GH_BOT_NAME }}
publish: true
token: ${{ secrets.GH_BOT_TOKEN }}
validate: false