Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmmjackson committed Aug 27, 2023
1 parent 94172da commit 651b2ff
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 49 deletions.
3 changes: 3 additions & 0 deletions build/aarch64-apple-darwin.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ARCH=arm64
PLATFORM=darwin
UPNOTIFY_BINARY=target/aarch64-apple-darwin/release/upnotify
47 changes: 0 additions & 47 deletions build/cross-release.sh

This file was deleted.

19 changes: 19 additions & 0 deletions build/nfpm.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# nfpm example configuration file
#
# check https://nfpm.goreleaser.com/configuration for detailed usage
#
name: "upnotify"
arch: "${ARCH}"
platform: "${PLATFORM}"
version: "${VERSION}"
section: "default"
priority: "extra"
provides:
- "upnotify"
maintainer: "Scott Jackson <[email protected]>"
description: Tool to log to standard out when the status of a web service changes.
homepage: "https://github.com/scottmmjackson/upnotify"
license: "BSD 3.0"
contents:
- src: ${UPNOTIFY_BINARY}
dst: /usr/bin/upnotify
49 changes: 49 additions & 0 deletions build/program.rb.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# typed: false
# frozen_string_literal: true

class Upnotify < Formula
desc "Tool to log to standard out when the status of a web service changes."
homepage "https://github.com/scottmmjackson/upnotify"
version "${VERSION}"

on_macos do
if Hardware::CPU.intel?
url "${X86_DARWIN_RELEASE_URL}"
sha256 "${X86_DARWIN_RELEASE_SHA}"

def install
bin.install "upnotify"
end
end
if Hardware::CPU.intel?
url "${ARM64_DARWIN_RELEASE_URL}"
sha256 "${ARM64_DARWIN_RELEASE_SHA}"

def install
bin.install "upnotify"
end
end
end
on_linux do
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "${ARM64_LINUX_RELEASE_URL}"
sha256 "${ARM64_LINUX_RELEASE_SHA}"

def install
bin.install "bb2todotxt"
end
end
if Hardware::CPU.intel?
url "${X86_LINUX_RELEASE_URL}"
sha256 "${X86_LINUX_RELEASE_SHA}"

def install
bin.install "bb2todotxt"
end
end
end

test do
system "#{bin}/upnotify --version"
end
end
3 changes: 3 additions & 0 deletions build/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

git tag --list --contains "$(git log -n1 --pretty='%h')" --sort -refname | head -n 1
27 changes: 26 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
target:=`rustc -vV | sed -n 's|host: ||p'`
os_family:=os_family()
archive_type:=if os_family == "windows" { "zip" } else { "tarball" }
os:=os()
arch:=arch()
version:=`git tag`

default: build

sys-info:
@echo "os_family {{os_family()}}"
@echo "os {{os()}}"
@echo "arch: {{arch()}}"

clean:
rm -rf target

build:
cargo build --release --target {{target}}
cargo build --release --target {{target}}

build-mac-m1:
just target=aarch64-apple-darwin archive

archive-tarball:
tar czf target/{{target}}/release/upnotify-{{version}}-{{target}}.tar.gz target/{{target}}/release/upnotify

archive-zip:
zip target/{{target}}/release/upnotify-{{version}}-{{target}}.zip target/{{target}}/release/upnotify

archive: build
just archive-{{archive_type}}
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ enum Result {
}

fn main() {
let cli = Command::new("HTTP Status Monitor")
let cli = Command::new("Upnotify")
.version("0.1.0")
.author("Scott Jackson")
.about("Monitors HTTP status changes of a URL")
Expand Down

0 comments on commit 651b2ff

Please sign in to comment.