Skip to content

Commit

Permalink
Merge branch 'build-fixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
mvd-ows committed Apr 15, 2024
2 parents 9544901 + 5c47a48 commit 83b53b4
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Continuous Integration

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- run: env
- name: Checkout code
uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.19.13'
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/[email protected]
- name: Print staticcheck version
run: staticcheck -version
- name: Run go build
run: make mullvad-upgrade-tunnel
- name: Run go vet
run: make vet
- name: Run go fmt
run: if [ "$(go fmt | wc -l)" -ne 0 ]; then exit 1; fi
29 changes: 24 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
BIN = mullvad-upgrade-tunnel
GO_LDFLAGS = -buildid= -s -w -X main.VERSION=${VERSION}
export CGO_ENABLED = 0
export VERSION = ${shell git describe --tags 2>/dev/null}

.PHONY: mullvad-upgrade-tunnel
mullvad-upgrade-tunnel:
BIN = mullvad-upgrade-tunnel
GO_LDFLAGS = -buildid= -s -w -X main.VERSION=${VERSION}

.PHONY: all
all: ${BIN}

.PHONY: ${BIN}
${BIN}:
go build -a -trimpath -buildvcs=false -ldflags "${GO_LDFLAGS}" \
-o ${BIN} ./cmd/mullvad-upgrade-tunnel
-o ${BIN} ./cmd/${BIN}

.PHONY: install
install:
Expand All @@ -17,10 +21,25 @@ grpc:
protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative internal/grpc/ephemeralpeer.proto

.PHONY: upgrade
upgrade:
go get -u
go mod vendor
go mod tidy

.PHONY: clean
clean:
rm -f ${BIN}*

.PHONY: fmt
fmt:
go fmt ./...

.PHONY: vet
vet:
go vet ./...
staticcheck ./...

.PHONY: build-container
build-container:
podman build -t wgephemeralpeer .
Expand Down

0 comments on commit 83b53b4

Please sign in to comment.