Skip to content

Commit d95eeff

Browse files
authored
Merge pull request #891 from MarathonLabs/feature/cd-homebrew
feat(cd): autorelease homebrew formula
2 parents db9d97a + 14011d5 commit d95eeff

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/marathon.rb.liquid

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Marathon < Formula
2+
desc "Cross-platform test runner written for Android and iOS projects"
3+
homepage "https://docs.marathonlabs.io/runner/"
4+
url "https://github.com/MarathonLabs/marathon/releases/download/{{ version }}/marathon-{{ version }}.zip"
5+
sha256 "{{ sha256 }}"
6+
version "{{ version }}"
7+
license "GPL-2.0-only"
8+
9+
depends_on "openjdk@11"
10+
11+
def install
12+
rm_f Dir["bin/*.bat"]
13+
libexec.install %w[bin lib]
14+
(bin/"marathon").write_env_script libexec/"bin/marathon", Language::Java.overridable_java_home_env
15+
end
16+
end

.github/workflows/ci.yml

+24
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
distribution: 'temurin'
6767
java-version: '11'
6868
- uses: little-core-labs/[email protected]
69+
id: tag
6970
if: ${{ startsWith(github.ref, 'refs/tags/') }}
7071
- name: deliver maven
7172
run: |
@@ -92,6 +93,29 @@ jobs:
9293
env:
9394
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
9495
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
96+
- uses: actions/checkout@v4
97+
with:
98+
repository: 'Malinskiy/homebrew-tap'
99+
ref: 'master'
100+
path: 'homebrew-tap'
101+
token: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
102+
- uses: ruby/setup-ruby@v1
103+
with:
104+
ruby-version: 3.3
105+
- name: deliver homebrew formulae
106+
run: |
107+
gem install liquid-cli
108+
URL="https://github.com/MarathonLabs/marathon/releases/download/${{ steps.tag.outputs.tag }}/marathon-${{ steps.tag.outputs.tag }}.zip"
109+
SHA256=$(curl -L --retry 5 --retry-max-time 120 $URL | sha256sum | sed 's/ -//')
110+
echo "{\"version\":\"${{ steps.tag.outputs.tag }}\",\"sha256\":\"$SHA256\"}" > .github/marathon.json
111+
cat .github/marathon.json | jq .
112+
cat .github/marathon.rb.liquid | liquid "$(< .github/marathon.json)" > homebrew-tap/Formula/marathon.rb
113+
cd homebrew-tap
114+
git config --global user.name 'Anton Malinskiy'
115+
git config --global user.email '[email protected]'
116+
git commit -am "Brew formula update for marathon version ${{ steps.tag.outputs.tag }}"
117+
git push
118+
95119
notify:
96120
needs: cd-release
97121
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)