Skip to content

Commit

Permalink
feat(cd): autorelease homebrew formula
Browse files Browse the repository at this point in the history
  • Loading branch information
Malinskiy committed Feb 4, 2024
1 parent d81a946 commit 663b5f0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/marathon.rb.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class Marathon < Formula
desc "Cross-platform test runner written for Android and iOS projects"
homepage "https://docs.marathonlabs.io/runner/"
url "https://github.com/MarathonLabs/marathon/releases/download/{{ version }}/marathon-{{ version }}.zip"
sha256 "{{ sha256 }}"
version "{{ version }}"
license "GPL-2.0-only"

depends_on "openjdk@11"

def install
rm_f Dir["bin/*.bat"]
libexec.install %w[bin lib]
(bin/"marathon").write_env_script libexec/"bin/marathon", Language::Java.overridable_java_home_env
end
end
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
distribution: 'temurin'
java-version: '11'
- uses: little-core-labs/get-git-tag@v3.0.2
id: tag
if: ${{ startsWith(github.ref, 'refs/tags/') }}
- name: deliver maven
run: |
Expand All @@ -92,6 +93,29 @@ jobs:
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
- uses: actions/checkout@v4
with:
repository: 'Malinskiy/homebrew-tap'
ref: 'master'
path: 'homebrew-tap'
token: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: deliver homebrew formulae
run: |
gem install liquid-cli
URL="https://github.com/MarathonLabs/marathon/releases/download/${{ steps.tag.outputs.tag }}/marathon-${{ steps.tag.outputs.tag }}.zip"
SHA256=$(curl -L --retry 5 --retry-max-time 120 $URL | sha256sum | sed 's/ -//')
echo "{\"version\":\"${{ steps.tag.outputs.tag }}\",\"sha256\":\"$SHA256\"}" > .github/marathon.json
cat .github/marathon.json | jq .
cat .github/marathon.rb.liquid | liquid "$(< .github/marathon.json)" > homebrew-tap/Formula/marathon.rb
cd homebrew-tap
git config --global user.name 'Anton Malinskiy'
git config --global user.email 'malinskiy@users.noreply.github.com'
git commit -am "Brew formula update for marathon version ${{ steps.tag.outputs.tag }}"
git push
notify:
needs: cd-release
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 663b5f0

Please sign in to comment.