mirror of
https://github.com/bybrooklyn/openbitdo.git
synced 2026-03-19 04:12:56 -04:00
release prep: rc.1 baseline and gating updates
This commit is contained in:
33
packaging/homebrew/Formula/openbitdo.rb
Normal file
33
packaging/homebrew/Formula/openbitdo.rb
Normal file
@@ -0,0 +1,33 @@
|
||||
class Openbitdo < Formula
|
||||
desc "Beginner-first clean-room 8BitDo TUI utility"
|
||||
homepage "https://github.com/bybrooklyn/openbitdo"
|
||||
license "BSD-3-Clause"
|
||||
version "0.0.1-rc.1"
|
||||
|
||||
on_macos do
|
||||
if Hardware::CPU.arm?
|
||||
url "https://github.com/bybrooklyn/openbitdo/releases/download/v0.0.1-rc.1/openbitdo-v0.0.1-rc.1-macos-arm64.tar.gz"
|
||||
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
|
||||
end
|
||||
end
|
||||
|
||||
on_linux do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://github.com/bybrooklyn/openbitdo/releases/download/v0.0.1-rc.1/openbitdo-v0.0.1-rc.1-linux-x86_64.tar.gz"
|
||||
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
|
||||
elsif Hardware::CPU.arm?
|
||||
url "https://github.com/bybrooklyn/openbitdo/releases/download/v0.0.1-rc.1/openbitdo-v0.0.1-rc.1-linux-aarch64.tar.gz"
|
||||
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
|
||||
end
|
||||
end
|
||||
|
||||
# Release automation rewrites checksums in the tap with authoritative values
|
||||
# from published assets.
|
||||
def install
|
||||
bin.install "bin/openbitdo"
|
||||
end
|
||||
|
||||
test do
|
||||
assert_match "openbitdo", shell_output("#{bin}/openbitdo --help")
|
||||
end
|
||||
end
|
||||
31
packaging/homebrew/Formula/openbitdo.rb.tmpl
Normal file
31
packaging/homebrew/Formula/openbitdo.rb.tmpl
Normal file
@@ -0,0 +1,31 @@
|
||||
class Openbitdo < Formula
|
||||
desc "Beginner-first clean-room 8BitDo TUI utility"
|
||||
homepage "https://github.com/@REPOSITORY@"
|
||||
license "BSD-3-Clause"
|
||||
version "@VERSION@"
|
||||
|
||||
on_macos do
|
||||
if Hardware::CPU.arm?
|
||||
url "https://github.com/@REPOSITORY@/releases/download/@UPSTREAM_TAG@/openbitdo-@UPSTREAM_TAG@-macos-arm64.tar.gz"
|
||||
sha256 "@MACOS_ARM64_SHA256@"
|
||||
end
|
||||
end
|
||||
|
||||
on_linux do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://github.com/@REPOSITORY@/releases/download/@UPSTREAM_TAG@/openbitdo-@UPSTREAM_TAG@-linux-x86_64.tar.gz"
|
||||
sha256 "@LINUX_X86_64_SHA256@"
|
||||
elsif Hardware::CPU.arm?
|
||||
url "https://github.com/@REPOSITORY@/releases/download/@UPSTREAM_TAG@/openbitdo-@UPSTREAM_TAG@-linux-aarch64.tar.gz"
|
||||
sha256 "@LINUX_AARCH64_SHA256@"
|
||||
end
|
||||
end
|
||||
|
||||
def install
|
||||
bin.install "bin/openbitdo"
|
||||
end
|
||||
|
||||
test do
|
||||
assert_match "openbitdo", shell_output("#{bin}/openbitdo --help")
|
||||
end
|
||||
end
|
||||
14
packaging/homebrew/README.md
Normal file
14
packaging/homebrew/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Homebrew Packaging
|
||||
|
||||
Formula source lives in `Formula/openbitdo.rb`.
|
||||
Template source used for release rendering: `Formula/openbitdo.rb.tmpl`.
|
||||
|
||||
Planned tap:
|
||||
- `bybrooklyn/homebrew-openbitdo`
|
||||
|
||||
Current status:
|
||||
- release workflow computes checksum-pinned formula values from published assets
|
||||
- tap sync remains gated by `HOMEBREW_PUBLISH_ENABLED=1`
|
||||
|
||||
Optional sync helper:
|
||||
- `sync_tap.sh` (disabled by default unless `HOMEBREW_PUBLISH_ENABLED=1`)
|
||||
36
packaging/homebrew/sync_tap.sh
Executable file
36
packaging/homebrew/sync_tap.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if [[ "${HOMEBREW_PUBLISH_ENABLED:-0}" != "1" ]]; then
|
||||
echo "homebrew tap sync disabled (set HOMEBREW_PUBLISH_ENABLED=1 to enable)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -z "${HOMEBREW_TAP_TOKEN:-}" ]]; then
|
||||
echo "missing HOMEBREW_TAP_TOKEN" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
TAP_REPO="${HOMEBREW_TAP_REPO:-bybrooklyn/homebrew-openbitdo}"
|
||||
FORMULA_SOURCE="${FORMULA_SOURCE:-$ROOT/packaging/homebrew/Formula/openbitdo.rb}"
|
||||
TMP="$(mktemp -d)"
|
||||
|
||||
if [[ ! -f "$FORMULA_SOURCE" ]]; then
|
||||
echo "formula source not found: $FORMULA_SOURCE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git clone "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/${TAP_REPO}.git" "$TMP/tap"
|
||||
mkdir -p "$TMP/tap/Formula"
|
||||
cp "$FORMULA_SOURCE" "$TMP/tap/Formula/openbitdo.rb"
|
||||
|
||||
cd "$TMP/tap"
|
||||
git config user.name "${GIT_AUTHOR_NAME:-openbitdo-ci}"
|
||||
git config user.email "${GIT_AUTHOR_EMAIL:-actions@users.noreply.github.com}"
|
||||
git add Formula/openbitdo.rb
|
||||
git commit -m "Update openbitdo formula" || {
|
||||
echo "no formula changes to push"
|
||||
exit 0
|
||||
}
|
||||
git push
|
||||
Reference in New Issue
Block a user