chore/devbox plugin (#1301)

* chore: Add Homebrew Casks for snrd/hway

* fix: Tag bump format for npm packages

* chore: Remove plugin setup
This commit is contained in:
Prad Nukala
2025-10-04 08:55:54 -04:00
committed by GitHub
parent e4450f52a4
commit 6f6a20922c
17 changed files with 155 additions and 1165 deletions
+71 -11
View File
@@ -97,8 +97,8 @@ builds:
- -X main.Commit={{.Commit}}
- -s -w
aurs:
- name: hway-bin
aur_sources:
- name: hway
disable: true
homepage: "https://sonr.io"
description: "Highway service - bridge between the Public Internet and Sonr blockchain"
@@ -106,37 +106,55 @@ aurs:
- "Sonr <support@sonr.io>"
license: "Apache-2.0"
private_key: "{{ .Env.AUR_KEY }}"
git_url: "ssh://[email protected]/hway-bin.git"
git_url: "ssh://[email protected]/hway.git"
skip_upload: auto
provides:
- hway
conflicts:
- hway
- hway-bin
depends:
- glibc
- redis
optdepends:
- "docker: for container-based vault operations"
makedepends:
- go
- git
- make
commit_msg_template: "Update to {{ .Tag }}"
commit_author:
name: goreleaserbot
email: "prad@sonr.io"
prepare: |-
cd "${pkgname}_${pkgver}"
go mod download
build: |-
cd "${pkgname}_${pkgver}"
export CGO_ENABLED=1
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
go build \
-ldflags="-w -s -buildid='' -linkmode=external \
-X main.Version=${pkgver}" \
-o hway ./cmd/hway
chmod +x ./hway
package: |-
cd "${pkgname}_${pkgver}"
# bin
install -Dm755 "./hway" "${pkgdir}/usr/bin/hway"
# license
if [ -f "./LICENSE" ]; then
install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/hway-bin/LICENSE"
install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/hway/LICENSE"
fi
# readme
if [ -f "./README.md" ]; then
install -Dm644 "./README.md" "${pkgdir}/usr/share/doc/hway-bin/README.md"
fi
# systemd service (if exists)
if [ -f "./hway.service" ]; then
install -Dm644 "./hway.service" "${pkgdir}/usr/lib/systemd/system/hway.service"
install -Dm644 "./README.md" "${pkgdir}/usr/share/doc/hway/README.md"
fi
nix:
@@ -173,6 +191,29 @@ archives:
- src: README*
wrap_in_directory: false
homebrew_casks:
- name: hway
ids:
- hway
homepage: "https://sonr.io"
description: "Highway service - bridge between the Public Internet and Sonr blockchain"
commit_msg_template: "Brew cask update for {{ .ProjectName }} version {{ .Tag }}"
directory: Casks
repository:
owner: sonr-io
name: homebrew-tap
branch: main
token: "{{ .Env.GITHUB_TOKEN }}"
commit_author:
name: goreleaserbot
email: "prad@sonr.io"
hooks:
post:
install: |
if OS.mac?
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/hway"]
end
nfpms:
- id: hway
package_name: hway
@@ -220,6 +261,25 @@ release:
checksum:
name_template: 'hway_checksums.txt'
npms:
- name: "@sonr.io/hway"
ids:
- hway
description: "Highway service - bridge between the Public Internet and Sonr blockchain"
homepage: "https://sonr.io"
license: "Apache-2.0"
author: "Sonr <support@sonr.io>"
repository: "https://github.com/sonr-io/sonr"
bugs: "https://github.com/sonr-io/sonr/issues"
keywords:
- highway
- bridge
- blockchain
- sonr
- service
access: public
format: tar.gz
snapshot:
version_template: "{{ incpatch .Version }}-dev"
View File
-33
View File
@@ -1,33 +0,0 @@
version: "0.5"
processes:
postgres-sonr:
command: |
# Generate pgsodium key if not set
if [ -z "${PGSODIUM_ROOT_KEY}" ]; then
echo "Generating pgsodium root key..."
export PGSODIUM_ROOT_KEY=$(openssl rand -hex 32)
echo "Generated key: ${PGSODIUM_ROOT_KEY:0:10}..."
fi
# Run the container using the pre-built image
docker run --rm \
--name ${POSTGRES_CONTAINER_NAME} \
-e POSTGRES_USER="${POSTGRES_USER:-postgres}" \
-e POSTGRES_DB="${POSTGRES_DB:-sonr}" \
-e PGSODIUM_ROOT_KEY="${PGSODIUM_ROOT_KEY}" \
-v ${POSTGRES_DATA_DIR}:/var/lib/postgresql/data \
-p ${POSTGRES_PORT:-5432}:5432 \
${POSTGRES_DOCKER_IMAGE}
availability:
restart: "on_failure"
backoff_seconds: 5
max_restarts: 5
readiness_probe:
exec:
command: "docker exec ${POSTGRES_CONTAINER_NAME} pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-hway}"
initial_delay_seconds: 15
period_seconds: 10
shutdown:
command: "docker stop ${POSTGRES_CONTAINER_NAME} || true"
timeout_seconds: 30
log_location: "{{ .Virtenv }}/logs/postgres-sonr.log"
-22
View File
@@ -1,22 +0,0 @@
{
"name": "hway",
"version": "0.0.3",
"description": "Plugin for Sonr Hway Gateway",
"packages": [],
"env": {},
"create_files": {
"{{ .Virtenv }}/data": "",
"{{ .Virtenv }}/logs": "",
"{{ .Virtenv }}/process-compose.yaml": "etc/process-compose.yaml",
"{{ .DevboxDir }}/init.sh": "etc/init.sh"
},
"shell": {
"init_hook": ["chmod +x {{ .DevboxDir }}/init.sh", "{{ .DevboxDir }}/init.sh"],
"scripts": {
"start": "devbox services start postgres-sonr",
"stop": "devbox services stop postgres-sonr",
"restart": "devbox services restart postgres-sonr",
"logs": "docker logs -f ${POSTGRES_CONTAINER_NAME}"
}
}
}