-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create deployment pipeline for Homebrew (#669)
* Update upload-binary.yml * test CI 3 * test CI 5 * test CI 6 * test CI 7 * tes CI 8 * test CI 9 * create monika.rb * add script tbump version * try comment * use action brew * add example rb file * use minimized code * add workflow run trigger Co-authored-by: Nico Prananta <[email protected]>
- Loading branch information
1 parent
d3eb10c
commit 2b2444f
Showing
3 changed files
with
70 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Publish to Homebrew | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_run: # Only trigger, when the npm-publish workflow succeeded | ||
workflows: ["Node.js Package"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
homebrew: | ||
name: Bump Homebrew formula | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get Package Version | ||
id: package-version | ||
uses: martinbeentjes/npm-get-version-action@master | ||
|
||
- uses: mislav/bump-homebrew-formula-action@v2 | ||
with: | ||
formula-name: monika | ||
download-url: https://registry.npmjs.org/@hyperjumptech/monika/-/monika-${{ steps.package-version.outputs.current-version }}.tgz | ||
env: | ||
COMMITTER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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,44 @@ | ||
# This file is an example file and generated using https://github.com/zmwangx/homebrew-npm-noob | ||
require "language/node" | ||
|
||
class Monika < Formula | ||
desc "Synthetic monitoring made easy" | ||
homepage "https://monika.hyperjump.tech" | ||
url "https://registry.npmjs.org/@hyperjumptech/monika/-/monika-1.7.2.tgz" | ||
sha256 "ec1e6a934ab1343c3dc5e576dcb73a78cdd6852f8353891889fec0ad4db18bf5" | ||
license "MIT" | ||
|
||
depends_on "node" | ||
|
||
def install | ||
system "npm", "install", *Language::Node.std_npm_install_args(libexec) | ||
bin.install_symlink Dir["#{libexec}/bin/*"] | ||
|
||
# Remove unexpected universal binaries | ||
deuniversalize_machos | ||
end | ||
|
||
test do | ||
(testpath/"config.yml").write <<~EOS | ||
notifications: | ||
- id: 5b3052ed-4d92-4f5d-a949-072b3ebb2497 | ||
type: desktop | ||
probes: | ||
- id: 696a3f57-a674-44b5-8125-a62bd2709ac5 | ||
name: 'test brew.sh' | ||
requests: | ||
- url: https://brew.sh | ||
body: {} | ||
timeout: 10000 | ||
EOS | ||
|
||
monika_stdout = (testpath/"monika.log") | ||
fork do | ||
$stdout.reopen(monika_stdout) | ||
exec bin/"monika", "-r", "1", "-c", testpath/"config.yml" | ||
end | ||
sleep 5 | ||
|
||
assert_match "Starting Monika. Probes: 1. Notifications: 1", monika_stdout.read | ||
end | ||
end |