Skip to content

Commit 79617a1

Browse files
committed
ci: add GitHub Actions release workflow; fix goreleaser and Makefile repo refs
- Add .github/workflows/release.yml: triggers on v* tags, runs go test -race, then GoReleaser via goreleaser-action@v6 (no local install required) - Fix .goreleaser.yaml release.github owner/name: static-web/server -> BackendStack21/static-web - Fix Makefile LDFLAGS module path: github.com/static-web/server -> github.com/BackendStack21/static-web
1 parent 4978ce5 commit 79617a1

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: GoReleaser
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version-file: go.mod
25+
cache: true
26+
27+
- name: Run tests
28+
run: go test -race ./...
29+
30+
- name: Run GoReleaser
31+
uses: goreleaser/goreleaser-action@v6
32+
with:
33+
distribution: goreleaser
34+
version: "~> v2"
35+
args: release --clean
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ changelog:
6868

6969
release:
7070
github:
71-
owner: static-web
72-
name: server
71+
owner: BackendStack21
72+
name: static-web
7373
draft: false
7474
prerelease: auto
7575
name_template: "v{{ .Version }}"

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
99
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo none)
1010
DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
1111

12-
LDFLAGS := -X github.com/static-web/server/internal/version.Version=$(VERSION) \
13-
-X github.com/static-web/server/internal/version.Commit=$(COMMIT) \
14-
-X github.com/static-web/server/internal/version.Date=$(DATE)
12+
LDFLAGS := -X github.com/BackendStack21/static-web/internal/version.Version=$(VERSION) \
13+
-X github.com/BackendStack21/static-web/internal/version.Commit=$(COMMIT) \
14+
-X github.com/BackendStack21/static-web/internal/version.Date=$(DATE)
1515

1616
## build: compile the binary to bin/static-web (with version info)
1717
build:

0 commit comments

Comments
 (0)