-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7ca065
commit 4bf7570
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,3 +85,63 @@ jobs: | |
asset_path: beach_darwin_amd64.zip | ||
asset_name: beach_darwin_amd64.zip | ||
asset_content_type: application/zip | ||
|
||
- name: Calculate checksums | ||
id: calculate-checksums | ||
run: | | ||
echo "::set-output name=darwin_sha256sum::$(sha256sum beach_darwin_amd64.zip)" | ||
echo "::set-output name=linux_sha256sum::$(sha256sum beach_linux_amd64.zip)" | ||
homebrew: | ||
name: Homebrew release | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
|
||
- name: Check out Homebrew code | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: flownative/homebrew-flownative | ||
path: homebrew | ||
|
||
- name: Copy file | ||
uses: canastro/[email protected] | ||
with: | ||
source: .github/workflows/localbeach.rb.tpl | ||
target: homebrew/Formula/localbeach.rb | ||
|
||
- name: Replace version number | ||
uses: shitiomatic/str-replace@master | ||
with: | ||
find: "{{version}}" | ||
replace: ${{ github.ref }} | ||
include: homebrew/Formula/localbeach.rb | ||
|
||
- name: Replace SHA256 sum (darwin) | ||
uses: shitiomatic/str-replace@master | ||
with: | ||
find: "{{{darwin_sha256sum}}" | ||
replace: ${{needs.build.outputs.darwin_sha256sum}} | ||
include: homebrew/Formula/localbeach.rb | ||
|
||
- name: Replace SHA256 sum (linux) | ||
uses: shitiomatic/str-replace@master | ||
with: | ||
find: "{{linux_sha256sum}}" | ||
replace: ${{needs.build.outputs.linux_sha256sum}} | ||
include: homebrew/Formula/localbeach.rb | ||
|
||
- name: Commit update | ||
uses: EndBug/add-and-commit@v5 | ||
with: | ||
add: 'homebrew' | ||
branch: master | ||
cwd: './homebrew' | ||
message: 'localbeach: update to ${{ github.ref }}' | ||
|
||
- name: Push to git | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: flownative/homebrew-flownative | ||
directory: homebrew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# frozen_string_literal: true | ||
|
||
# | ||
# DO NOT EDIT THIS FILE MANUALLY | ||
# | ||
class Localbeach < Formula | ||
desc "Command-line tool for Flownative Beach" | ||
homepage "https://www.flownative.com/beach" | ||
license "GPL-3.0-or-later" | ||
version "{{version}}" | ||
|
||
if RUBY_PLATFORM.downcase.include?("darwin") | ||
url "https://github.com/flownative/localbeach/releases/download/{{version}}/beach_darwin_amd64.zip" | ||
sha256 "{{darwin_sha256sum}}" | ||
else | ||
url "https://github.com/flownative/localbeach/releases/download/{{version}}/beach_linux_amd64.zip" | ||
sha256 "{{linux_sha256sum}}" | ||
end | ||
|
||
bottle :unneeded | ||
|
||
conflicts_with "flownative/flownative/beach-cli", because: "localbeach replaces beach-cli" | ||
|
||
def install | ||
database_path = RUBY_PLATFORM.downcase.include?("darwin") ? "~/Library/Application Support/Flownative/Local Beach/MariaDB" : "~/.Flownative/Local Beach/MariaDB" | ||
|
||
bin.install "beach" => "beach" | ||
system "#{bin}/beach", "setup", "--docker-folder", "#{lib}/localbeach", "--database-folder", database_path | ||
end | ||
end |