this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: streamline release process

Signed-off-by: A. Ottr <alex@otter.foo>

A. Ottr 6dedc317 0c2f737a

+186 -85
+40
.goreleaser.yml
··· 1 + version: 2 2 + 3 + project_name: nox 4 + 5 + builds: 6 + - id: nox 7 + main: ./cmd/nox 8 + binary: nox 9 + goos: 10 + - linux 11 + - darwin 12 + goarch: 13 + - amd64 14 + - arm64 15 + env: 16 + - CGO_ENABLED=0 17 + ldflags: 18 + - -s -w 19 + - -X github.com/aottr/nox/internal/version.Version={{.Version}} 20 + - -X github.com/aottr/nox/internal/version.Commit={{.Commit}} 21 + - -X github.com/aottr/nox/internal/version.BuildDate={{.Date}} 22 + 23 + archives: 24 + - id: default 25 + files: 26 + - README.md 27 + - LICENSE 28 + 29 + changelog: 30 + sort: asc 31 + filters: 32 + exclude: 33 + - "^docs:" 34 + - "^test:" 35 + 36 + release: 37 + github: 38 + owner: aottr 39 + name: nox 40 +
+22 -22
.nox.yaml
··· 1 - interval: "10m" 2 - age: 3 - identity: "keys/key.txt" 4 - recipients: 5 - - "age1qq5sazxv755u2vs5ulyl486jxhlg7ztrvm27nya47aln668xldkqsm4kn5" 6 - statePath: ".nox-state.json" 1 + interval: 10m 2 + age: 3 + identity: keys/key.txt 4 + identities: [] 5 + recipients: 6 + - age1qq5sazxv755u2vs5ulyl486jxhlg7ztrvm27nya47aln668xldkqsm4kn5 7 + statePath: .nox-state.json 7 8 git: 8 - repo: git@github.com:ShorkBytes/nox-secrets.git 9 - branch: main 10 - apps: 11 - debug: 12 - git: 13 - repo: git@github.com:ShorkBytes/nox-secrets.git 14 - branch: main 15 - files: 16 - - path: debug/debug.age 17 - output: ./secrets/.env 18 - 19 - debug2: 9 + repo: git@github.com:ShorkBytes/nox-secrets.git 20 10 branch: main 21 - repo: git@github.com:ShorkBytes/nox-secrets.git 22 - files: 23 - - path: debug/debug.age 24 - output: ./secrets/debug2.env 11 + apps: 12 + debug: 13 + git: 14 + repo: git@github.com:ShorkBytes/nox-secrets.git 15 + branch: main 16 + files: 17 + - path: debug/debug.age 18 + output: ./secrets/.env 19 + debug2: 20 + files: 21 + - path: debug/debug.age 22 + output: ./secrets/debug2.env 23 + testApp: 24 + files: []
+54 -6
Makefile
··· 1 - .PHONY: build 1 + .PHONY: major minor patch 2 2 3 - build: 4 - @go build -o bin/nox ./cmd/nox/main.go 3 + VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev") 4 + COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown") 5 + BUILD_DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ) 6 + 7 + LDFLAGS = -s -w \ 8 + -X github.com/aottr/nox/internal/version.Version=$(VERSION) \ 9 + -X github.com/aottr/nox/internal/version.Commit=$(COMMIT) \ 10 + -X github.com/aottr/nox/internal/version.BuildDate=$(BUILD_DATE) 5 11 6 - .PHONY: run 7 - run: build 8 - @./bin/nox 12 + # Get current version tag (removes 'v' prefix if present, defaults to 0.0.0) 13 + CURRENT_TAG := $(shell git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.0") 14 + CURRENT_MAJOR := $(shell echo "$(CURRENT_TAG)" | awk -F. '{print $$1}' | grep -E '^[0-9]+$$' || echo "0") 15 + CURRENT_MINOR := $(shell echo "$(CURRENT_TAG)" | awk -F. '{print $$2}' | grep -E '^[0-9]+$$' || echo "0") 16 + CURRENT_PATCH := $(shell echo "$(CURRENT_TAG)" | awk -F. '{print $$3}' | grep -E '^[0-9]+$$' || echo "0") 17 + 18 + 19 + major: 20 + @CURRENT="$(CURRENT_TAG)"; \ 21 + if [ -z "$$CURRENT" ] || [ "$$CURRENT" = "0.0.0" ]; then \ 22 + NEW_VERSION="1.0.0"; \ 23 + else \ 24 + MAJOR=$$(echo "$$CURRENT" | awk -F. '{print $$1}'); \ 25 + NEW_VERSION="$$(($$MAJOR + 1)).0.0"; \ 26 + fi; \ 27 + echo "Bumping major version: $$CURRENT -> $$NEW_VERSION"; \ 28 + git tag -s "v$$NEW_VERSION" -m "Release v$$NEW_VERSION"; \ 29 + echo "Created signed tag v$$NEW_VERSION. Push with: git push origin v$$NEW_VERSION" 30 + 31 + minor: 32 + @CURRENT="$(CURRENT_TAG)"; \ 33 + if [ -z "$$CURRENT" ] || [ "$$CURRENT" = "0.0.0" ]; then \ 34 + NEW_VERSION="0.1.0"; \ 35 + else \ 36 + MAJOR=$$(echo "$$CURRENT" | awk -F. '{print $$1}'); \ 37 + MINOR=$$(echo "$$CURRENT" | awk -F. '{print $$2}'); \ 38 + NEW_VERSION="$$MAJOR.$$(($$MINOR + 1)).0"; \ 39 + fi; \ 40 + echo "Bumping minor version: $$CURRENT -> $$NEW_VERSION"; \ 41 + git tag -s "v$$NEW_VERSION" -m "Release v$$NEW_VERSION"; \ 42 + echo "Created signed tag v$$NEW_VERSION. Push with: git push origin v$$NEW_VERSION" 43 + 44 + patch: 45 + @CURRENT="$(CURRENT_TAG)"; \ 46 + if [ -z "$$CURRENT" ] || [ "$$CURRENT" = "0.0.0" ]; then \ 47 + NEW_VERSION="0.0.1"; \ 48 + else \ 49 + MAJOR=$$(echo "$$CURRENT" | awk -F. '{print $$1}'); \ 50 + MINOR=$$(echo "$$CURRENT" | awk -F. '{print $$2}'); \ 51 + PATCH=$$(echo "$$CURRENT" | awk -F. '{print $$3}'); \ 52 + NEW_VERSION="$$MAJOR.$$MINOR.$$(($$PATCH + 1))"; \ 53 + fi; \ 54 + echo "Bumping patch version: $$CURRENT -> $$NEW_VERSION"; \ 55 + git tag -s "v$$NEW_VERSION" -m "Release v$$NEW_VERSION"; \ 56 + echo "Created signed tag v$$NEW_VERSION. Push with: git push origin v$$NEW_VERSION"
+62 -57
cmd/nox/main.go
··· 128 128 }, 129 129 { 130 130 Name: "generate", 131 - Flags: []cli.Flag{ 132 - &cli.StringFlag{ 133 - Name: "output", 134 - Usage: "path to output file", 135 - Aliases: []string{"o"}, 136 - Value: constants.StandardOutput, 137 - Destination: &outputPath, 138 - }, 139 - }, 140 - Action: func(ctx context.Context, cmd *cli.Command) error { 131 + Commands: []*cli.Command{ 132 + { 133 + Name: "key", 134 + Flags: []cli.Flag{ 135 + &cli.StringFlag{ 136 + Name: "output", 137 + Usage: "path to output file", 138 + Aliases: []string{"o"}, 139 + Value: constants.StandardOutput, 140 + Destination: &outputPath, 141 + }, 142 + }, 143 + Action: func(ctx context.Context, cmd *cli.Command) error { 141 144 142 - output := cmd.String("output") 143 - switch output { 144 - case constants.StandardOutput: 145 - priv, pub, err := crypto.GenerateIdentity("") 146 - if err != nil { 147 - return err 148 - } 149 - fmt.Println("Public key:\n", pub, "\nPrivate Key:\n", priv) 150 - default: 151 - _, _, err := crypto.GenerateIdentity(cmd.String("output")) 152 - if err != nil { 153 - return err 154 - } 155 - } 145 + output := cmd.String("output") 146 + switch output { 147 + case constants.StandardOutput: 148 + priv, pub, err := crypto.GenerateIdentity("") 149 + if err != nil { 150 + return err 151 + } 152 + fmt.Println("Public key:\n", pub, "\nPrivate Key:\n", priv) 153 + default: 154 + _, _, err := crypto.GenerateIdentity(cmd.String("output")) 155 + if err != nil { 156 + return err 157 + } 158 + } 156 159 157 - return nil 160 + return nil 161 + }, 162 + }, 163 + { 164 + Name: "config", 165 + Usage: "Initialize a new config or app", 166 + Flags: []cli.Flag{ 167 + &cli.StringFlag{ 168 + Name: "app", 169 + Usage: "name of the app", 170 + }, 171 + &cli.StringFlag{ 172 + Name: "repo", 173 + Usage: "git repository url", 174 + }, 175 + &cli.StringFlag{ 176 + Name: "branch", 177 + Value: "main", 178 + Usage: "git branch", 179 + }, 180 + &cli.StringFlag{ 181 + Name: "key", 182 + Usage: "path to age key", 183 + }, 184 + }, 185 + Action: func(ctx context.Context, cmd *cli.Command) error { 186 + return config.InitConfig( 187 + configPath, 188 + cmd.String("app"), 189 + cmd.String("repo"), 190 + cmd.String("branch"), 191 + cmd.String("key"), 192 + ) 193 + }, 194 + }, 158 195 }, 159 196 }, 160 197 { ··· 215 252 log.Error("failed to build runtime context", "error", err.Error()) 216 253 } 217 254 return processor.ValidateConfig(rtx.Config) 218 - }, 219 - }, 220 - { 221 - Name: "init", 222 - Usage: "Initialize a new config or app", 223 - Flags: []cli.Flag{ 224 - &cli.StringFlag{ 225 - Name: "app", 226 - Usage: "name of the app", 227 - }, 228 - &cli.StringFlag{ 229 - Name: "repo", 230 - Usage: "git repository url", 231 - }, 232 - &cli.StringFlag{ 233 - Name: "branch", 234 - Value: "main", 235 - Usage: "git branch", 236 - }, 237 - &cli.StringFlag{ 238 - Name: "key", 239 - Usage: "path to age key", 240 - }, 241 - }, 242 - Action: func(ctx context.Context, cmd *cli.Command) error { 243 - return config.InitConfig( 244 - configPath, 245 - cmd.String("app"), 246 - cmd.String("repo"), 247 - cmd.String("branch"), 248 - cmd.String("key"), 249 - ) 250 255 }, 251 256 }, 252 257 {
+8
internal/version/version.go
··· 1 + package version 2 + 3 + var ( 4 + Version = "dev" 5 + Commit = "unknown" 6 + BuildDate = "unknown" 7 + ) 8 +