mirror of
https://github.com/DeBrosOfficial/orama.git
synced 2026-06-16 23:14:13 +00:00
ci: single VERSION file, version guards, goreleaser v2, CI on push
Workflow hardening based on the four-cycle release-debugging session:
Centralized versioning
- Add /VERSION at repo root as single source of truth.
- core/Makefile reads VERSION via `$(shell cat ../VERSION)`.
- Add `make bump VER=X.Y.Z` target that updates /VERSION and syncs
sdk/package.json in one shot.
Version mismatch guards
- All three release workflows (release.yaml, release-apt.yml,
publish-sdk.yml) now verify the release tag matches /VERSION at the
very first step. Stale-VERSION releases fail fast with a clear hint
to run `make bump`.
GoReleaser v2 migration
- Upgrade goreleaser-action v5 -> v6 (pinned `~> v2`).
- Add `version: 2` to .goreleaser.yaml.
- Migrate to v2 syntax: `archives.format` -> `formats: [...]`,
`brews.folder` -> `directory`, `snapshot.name_template` ->
`version_template`, `builds`-style references replaced with `ids:`.
- `before.hooks` can use map syntax again (v2 supports it).
Homebrew tap on stable only
- `brews.skip_upload` is now `'{{ if .Prerelease }}true{{ else }}false{{ end }}'`.
- Stops nightly releases from polluting the tap and from hitting 401
on stale HOMEBREW_TAP_TOKEN. Stable main releases still publish.
CI on every push
- New ci.yml runs `go vet` + `go test -race` on the core module and
typecheck/build/unit-tests on the SDK for every push to main/nightly
and every PR. version-sanity job warns when /VERSION and
sdk/package.json drift.
Version bump for next pipeline test
- /VERSION: 0.122.8
- sdk/package.json: 0.122.8
This commit is contained in:
parent
6e31184d0e
commit
8e4d11a6ce
85
.github/workflows/ci.yml
vendored
Normal file
85
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- nightly
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- nightly
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ci-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
go-test:
|
||||||
|
name: Go tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.24"
|
||||||
|
cache-dependency-path: core/go.sum
|
||||||
|
|
||||||
|
- name: Vet
|
||||||
|
working-directory: core
|
||||||
|
run: go vet ./...
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
working-directory: core
|
||||||
|
run: go test -race -timeout 5m ./...
|
||||||
|
|
||||||
|
sdk-build:
|
||||||
|
name: SDK typecheck, build, unit tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: sdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "20"
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Typecheck
|
||||||
|
run: pnpm typecheck
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: pnpm build
|
||||||
|
|
||||||
|
- name: Unit tests
|
||||||
|
run: pnpm vitest run tests/unit
|
||||||
|
|
||||||
|
version-sanity:
|
||||||
|
name: Verify VERSION ↔ sdk/package.json sync
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Compare versions
|
||||||
|
run: |
|
||||||
|
ROOT=$(tr -d '[:space:]' < VERSION)
|
||||||
|
SDK=$(node -p "require('./sdk/package.json').version")
|
||||||
|
if [ "$ROOT" != "$SDK" ]; then
|
||||||
|
echo "::warning::/VERSION ($ROOT) and sdk/package.json ($SDK) differ. Run 'make -C core bump VER=$ROOT' to sync."
|
||||||
|
else
|
||||||
|
echo "Versions in sync: $ROOT"
|
||||||
|
fi
|
||||||
14
.github/workflows/publish-sdk.yml
vendored
14
.github/workflows/publish-sdk.yml
vendored
@ -28,6 +28,20 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Verify VERSION file matches release tag
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
working-directory: .
|
||||||
|
run: |
|
||||||
|
TAG="${{ github.event.release.tag_name }}"
|
||||||
|
EXPECTED="${TAG#v}"
|
||||||
|
EXPECTED="${EXPECTED%-nightly}"
|
||||||
|
ACTUAL=$(tr -d '[:space:]' < VERSION)
|
||||||
|
if [ "$EXPECTED" != "$ACTUAL" ]; then
|
||||||
|
echo "::error::Tag $TAG implies version '$EXPECTED' but /VERSION says '$ACTUAL'."
|
||||||
|
echo "::error::Run 'make -C core bump VER=$EXPECTED' and commit before tagging."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
13
.github/workflows/release-apt.yml
vendored
13
.github/workflows/release-apt.yml
vendored
@ -25,6 +25,19 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Verify VERSION file matches release tag
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
run: |
|
||||||
|
TAG="${{ github.event.release.tag_name }}"
|
||||||
|
EXPECTED="${TAG#v}"
|
||||||
|
EXPECTED="${EXPECTED%-nightly}"
|
||||||
|
ACTUAL=$(tr -d '[:space:]' < VERSION)
|
||||||
|
if [ "$EXPECTED" != "$ACTUAL" ]; then
|
||||||
|
echo "::error::Tag $TAG implies version '$EXPECTED' but /VERSION says '$ACTUAL'."
|
||||||
|
echo "::error::Run 'make -C core bump VER=$EXPECTED' and commit before tagging."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
|
|||||||
27
.github/workflows/release.yaml
vendored
27
.github/workflows/release.yaml
vendored
@ -13,29 +13,42 @@ permissions:
|
|||||||
jobs:
|
jobs:
|
||||||
build-release:
|
build-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Need full history for changelog
|
fetch-depth: 0 # Need full history for changelog
|
||||||
|
|
||||||
|
- name: Verify VERSION file matches release tag
|
||||||
|
run: |
|
||||||
|
TAG="${GITHUB_REF_NAME}"
|
||||||
|
EXPECTED="${TAG#v}"
|
||||||
|
EXPECTED="${EXPECTED%-nightly}"
|
||||||
|
ACTUAL=$(tr -d '[:space:]' < VERSION)
|
||||||
|
if [ "$EXPECTED" != "$ACTUAL" ]; then
|
||||||
|
echo "::error::Tag $TAG implies version '$EXPECTED' but /VERSION says '$ACTUAL'."
|
||||||
|
echo "::error::Run 'make -C core bump VER=$EXPECTED' and commit before tagging."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "VERSION file matches tag: $ACTUAL"
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.24'
|
go-version: '1.24'
|
||||||
cache-dependency-path: core/go.sum
|
cache-dependency-path: core/go.sum
|
||||||
|
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v5
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
distribution: goreleaser
|
distribution: goreleaser
|
||||||
version: latest
|
version: '~> v2'
|
||||||
args: release --clean
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
# GoReleaser Configuration for DeBros Network
|
# GoReleaser v2 Configuration for DeBros Network
|
||||||
# Builds and releases orama (CLI) and orama-node binaries
|
# Builds and releases orama (CLI) and orama-node binaries.
|
||||||
# Publishes to: GitHub Releases, Homebrew, and apt (.deb packages)
|
# Publishes to: GitHub Releases, Homebrew (stable only), and apt (.deb packages).
|
||||||
|
|
||||||
|
version: 2
|
||||||
project_name: orama-network
|
project_name: orama-network
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@ -9,7 +10,8 @@ env:
|
|||||||
|
|
||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
- go -C core mod tidy
|
- cmd: go mod tidy
|
||||||
|
dir: core
|
||||||
|
|
||||||
builds:
|
builds:
|
||||||
# orama CLI binary
|
# orama CLI binary
|
||||||
@ -50,9 +52,9 @@ builds:
|
|||||||
archives:
|
archives:
|
||||||
# Tar.gz archives for orama CLI
|
# Tar.gz archives for orama CLI
|
||||||
- id: orama-archives
|
- id: orama-archives
|
||||||
builds:
|
ids:
|
||||||
- orama
|
- orama
|
||||||
format: tar.gz
|
formats: [tar.gz]
|
||||||
name_template: "orama_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
name_template: "orama_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||||
files:
|
files:
|
||||||
- README.md
|
- README.md
|
||||||
@ -60,9 +62,9 @@ archives:
|
|||||||
|
|
||||||
# Tar.gz archives for orama-node
|
# Tar.gz archives for orama-node
|
||||||
- id: orama-node-archives
|
- id: orama-node-archives
|
||||||
builds:
|
ids:
|
||||||
- orama-node
|
- orama-node
|
||||||
format: tar.gz
|
formats: [tar.gz]
|
||||||
name_template: "orama-node_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
name_template: "orama-node_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||||
files:
|
files:
|
||||||
- README.md
|
- README.md
|
||||||
@ -73,7 +75,7 @@ nfpms:
|
|||||||
# orama CLI .deb package
|
# orama CLI .deb package
|
||||||
- id: orama-deb
|
- id: orama-deb
|
||||||
package_name: orama
|
package_name: orama
|
||||||
builds:
|
ids:
|
||||||
- orama
|
- orama
|
||||||
vendor: DeBros
|
vendor: DeBros
|
||||||
homepage: https://github.com/DeBrosDAO/orama
|
homepage: https://github.com/DeBrosDAO/orama
|
||||||
@ -95,7 +97,7 @@ nfpms:
|
|||||||
# orama-node .deb package
|
# orama-node .deb package
|
||||||
- id: orama-node-deb
|
- id: orama-node-deb
|
||||||
package_name: orama-node
|
package_name: orama-node
|
||||||
builds:
|
ids:
|
||||||
- orama-node
|
- orama-node
|
||||||
vendor: DeBros
|
vendor: DeBros
|
||||||
homepage: https://github.com/DeBrosDAO/orama
|
homepage: https://github.com/DeBrosDAO/orama
|
||||||
@ -114,7 +116,9 @@ nfpms:
|
|||||||
lintian_overrides:
|
lintian_overrides:
|
||||||
- statically-linked-binary
|
- statically-linked-binary
|
||||||
|
|
||||||
# Homebrew tap for macOS (orama CLI only)
|
# Homebrew tap for macOS (orama CLI only).
|
||||||
|
# Stable releases only — prereleases (nightly) are skipped so we don't
|
||||||
|
# pollute the tap or fight a 401 on a missing HOMEBREW_TAP_TOKEN.
|
||||||
brews:
|
brews:
|
||||||
- name: orama
|
- name: orama
|
||||||
ids:
|
ids:
|
||||||
@ -123,10 +127,11 @@ brews:
|
|||||||
owner: DeBrosDAO
|
owner: DeBrosDAO
|
||||||
name: homebrew-tap
|
name: homebrew-tap
|
||||||
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
|
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
|
||||||
folder: Formula
|
directory: Formula
|
||||||
homepage: https://github.com/DeBrosDAO/orama
|
homepage: https://github.com/DeBrosDAO/orama
|
||||||
description: CLI tool for the Orama decentralized network
|
description: CLI tool for the Orama decentralized network
|
||||||
license: MIT
|
license: MIT
|
||||||
|
skip_upload: '{{ if .Prerelease }}true{{ else }}false{{ end }}'
|
||||||
install: |
|
install: |
|
||||||
bin.install "orama"
|
bin.install "orama"
|
||||||
test: |
|
test: |
|
||||||
@ -137,7 +142,7 @@ checksum:
|
|||||||
algorithm: sha256
|
algorithm: sha256
|
||||||
|
|
||||||
snapshot:
|
snapshot:
|
||||||
name_template: "{{ incpatch .Version }}-next"
|
version_template: "{{ incpatch .Version }}-next"
|
||||||
|
|
||||||
changelog:
|
changelog:
|
||||||
sort: asc
|
sort: asc
|
||||||
|
|||||||
@ -61,9 +61,11 @@ test-e2e-quick:
|
|||||||
# Network - Distributed P2P Database System
|
# Network - Distributed P2P Database System
|
||||||
# Makefile for development and build tasks
|
# Makefile for development and build tasks
|
||||||
|
|
||||||
.PHONY: build clean test deps tidy fmt vet lint install-hooks push-devnet push-testnet rollout-devnet rollout-testnet release
|
.PHONY: build clean test deps tidy fmt vet lint install-hooks push-devnet push-testnet rollout-devnet rollout-testnet release bump
|
||||||
|
|
||||||
VERSION := 0.122.7
|
# Single source of truth — repo-root VERSION file. Update with `make bump VER=X.Y.Z`
|
||||||
|
# or by editing /VERSION directly. Release workflows verify this matches the tag.
|
||||||
|
VERSION := $(shell cat ../VERSION 2>/dev/null | tr -d '[:space:]' || echo unknown)
|
||||||
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
||||||
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||||
LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' -X 'main.date=$(DATE)'
|
LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' -X 'main.date=$(DATE)'
|
||||||
@ -130,6 +132,17 @@ rollout-devnet:
|
|||||||
rollout-testnet:
|
rollout-testnet:
|
||||||
./bin/orama node rollout --env testnet --yes
|
./bin/orama node rollout --env testnet --yes
|
||||||
|
|
||||||
|
# Bump the repo-root VERSION file and sync sdk/package.json.
|
||||||
|
# Usage: make bump VER=0.122.9
|
||||||
|
bump:
|
||||||
|
@if [ -z "$(VER)" ]; then \
|
||||||
|
echo "Usage: make bump VER=X.Y.Z"; exit 1; \
|
||||||
|
fi
|
||||||
|
@echo "$(VER)" > ../VERSION
|
||||||
|
@cd ../sdk && npm version $(VER) --no-git-tag-version > /dev/null
|
||||||
|
@echo "Bumped VERSION and sdk/package.json to $(VER)"
|
||||||
|
@echo "Next: git add ../VERSION ../sdk/package.json && git commit -m 'release: $(VER)'"
|
||||||
|
|
||||||
# Interactive release workflow (tag + push)
|
# Interactive release workflow (tag + push)
|
||||||
release:
|
release:
|
||||||
@bash scripts/release.sh
|
@bash scripts/release.sh
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@debros/orama",
|
"name": "@debros/orama",
|
||||||
"version": "0.122.3",
|
"version": "0.122.8",
|
||||||
"description": "TypeScript SDK for Orama Network - Database, PubSub, Cache, Storage, Vault, and more",
|
"description": "TypeScript SDK for Orama Network - Database, PubSub, Cache, Storage, Vault, and more",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user