Skip to content

Commit 811ff47

Browse files
committed
Release fixes
1 parent 929034a commit 811ff47

4 files changed

Lines changed: 20 additions & 22 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [main, master]
88

9+
# Minimal permissions — no secrets needed for CI
10+
permissions:
11+
contents: read
12+
913
jobs:
1014
build-and-test:
1115
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
with:
8888
push: true
8989
context: .
90-
platforms: linux/amd64,linux/arm64,linux/arm/v7
90+
platforms: linux/amd64,linux/arm64
9191
tags: ${{ steps.meta.outputs.tags }}
9292
labels: ${{ steps.meta.outputs.labels }}
9393
build-args: |
@@ -108,17 +108,10 @@ jobs:
108108
goarch: amd64
109109
- goos: linux
110110
goarch: arm64
111-
- goos: linux
112-
goarch: arm
113-
goarm: "7"
114-
- goos: linux
115-
goarch: "386"
116111
- goos: darwin
117112
goarch: amd64
118113
- goos: darwin
119114
goarch: arm64
120-
- goos: freebsd
121-
goarch: amd64
122115
steps:
123116
- uses: actions/checkout@v6
124117

@@ -142,17 +135,17 @@ jobs:
142135
CGO_ENABLED: "0"
143136
GOOS: ${{ matrix.goos }}
144137
GOARCH: ${{ matrix.goarch }}
145-
GOARM: ${{ matrix.goarm }}
146138
run: |
147-
BINARY_NAME="wireguard-ui-${{ matrix.goos }}-${{ matrix.goarch }}"
148-
if [ -n "${{ matrix.goarm }}" ]; then
149-
BINARY_NAME="${BINARY_NAME}v${{ matrix.goarm }}"
150-
fi
151-
go build -ldflags="-X 'main.appVersion=${{ github.ref_name }}' -X 'main.buildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)' -X 'main.gitCommit=${{ github.sha }}'" \
152-
-o "${BINARY_NAME}" .
153-
tar czf "${BINARY_NAME}.tar.gz" "${BINARY_NAME}" init.sh
154-
155-
- name: Upload release asset
139+
ARCHIVE="wireguard-ui-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz"
140+
go build -trimpath \
141+
-ldflags="-s -w -X 'main.appVersion=${{ github.ref_name }}' -X 'main.buildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)' -X 'main.gitCommit=${{ github.sha }}'" \
142+
-o wireguard-ui .
143+
tar czf "${ARCHIVE}" wireguard-ui
144+
sha256sum "${ARCHIVE}" >> checksums.txt
145+
146+
- name: Upload release assets
156147
uses: softprops/action-gh-release@v3
157148
with:
158-
files: wireguard-ui-*.tar.gz
149+
files: |
150+
wireguard-ui-*.tar.gz
151+
checksums.txt

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ COPY . .
3232
COPY --from=frontend /src/assets ./assets/
3333

3434
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
35+
-trimpath \
3536
-ldflags="-s -w -X 'main.appVersion=${APP_VERSION}' -X 'main.buildTime=${BUILD_TIME}' -X 'main.gitCommit=${GIT_COMMIT}'" \
36-
-a -o wg-ui .
37+
-o wg-ui .
3738

3839
# Stage 3: Runtime
3940
FROM alpine:3.23

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ GO_PACKAGES := $(shell go list ./... | grep -v 'wireguard-ui$$' | grep -v node_m
55
VERSION ?= dev
66
GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "N/A")
77
BUILD_TIME := $(shell date -u '+%Y-%m-%d %H:%M:%S')
8-
LDFLAGS := -X 'main.appVersion=$(VERSION)' -X 'main.buildTime=$(BUILD_TIME)' -X 'main.gitCommit=$(GIT_COMMIT)'
8+
LDFLAGS := -s -w -X 'main.appVersion=$(VERSION)' -X 'main.buildTime=$(BUILD_TIME)' -X 'main.gitCommit=$(GIT_COMMIT)'
99

1010
.PHONY: help build build-frontend build-backend test test-verbose coverage lint lint-go lint-frontend fmt vet clean dev
1111

@@ -20,7 +20,7 @@ build-frontend: ## Build the React frontend
2020
npm ci && npm run build
2121

2222
build-backend: ## Build the Go binary
23-
CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -o $(APP_NAME) .
23+
CGO_ENABLED=0 go build -trimpath -ldflags="$(LDFLAGS)" -o $(APP_NAME) .
2424

2525
## ---- Test ----
2626

0 commit comments

Comments
 (0)