From 849bc584cc3874a7cc1b44a55c69c244c7f7834b Mon Sep 17 00:00:00 2001 From: gdm85 Date: Thu, 13 May 2021 19:00:40 +0200 Subject: [PATCH 1/3] Add GitHub actions to build master and each PR --- .github/workflows/go.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..ada858a --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,37 @@ +name: Go build for Linux +on: [push, pull_request] +jobs: + + build: + name: Build + runs-on: ubuntu-18.04 + steps: + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.12 + id: go + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Linux build + run: | + make + + - name: Upload Linux build + uses: actions/upload-artifact@v2 + with: + name: linux-amd64 + path: | + doh-client/doh-client + doh-server/doh-server + + - name: Cache + uses: actions/cache@v2 + with: + # A directory to store and save the cache + path: ~/go/pkg/mod + # An explicit key for restoring and saving the cache + key: ${{ runner.os }}-${{ hashFiles('**/go.sum') }} From 0bbd26c1b5fc2bd7393a1109f22d89fe7a01f48d Mon Sep 17 00:00:00 2001 From: gdm85 Date: Thu, 13 May 2021 19:19:44 +0200 Subject: [PATCH 2/3] Use Go 1.13 --- .github/workflows/go.yml | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ada858a..68af231 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -10,7 +10,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.12 + go-version: 1.13 id: go - name: Check out repository diff --git a/go.mod b/go.mod index fb18ed5..ca3576b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/m13253/dns-over-https -go 1.12 +go 1.13 require ( github.com/BurntSushi/toml v0.3.1 From 5af0d538ca792aae9803fcaf4ebbb0a02458177a Mon Sep 17 00:00:00 2001 From: gdm85 Date: Thu, 13 May 2021 19:20:46 +0200 Subject: [PATCH 3/3] Remove deps download, modern Go does it automatically --- Makefile | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index a122f7d..e65c210 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,11 @@ -.PHONY: all clean install uninstall deps +.PHONY: all clean install uninstall PREFIX = /usr/local ifeq ($(GOROOT),) GOBUILD = go build -GOGET = go get -d -v -GOGET_UPDATE = go get -d -u -v else GOBUILD = $(GOROOT)/bin/go build -GOGET = $(GOROOT)/bin/go get -d -v -GOGET_UPDATE = $(GOROOT)/bin/go get -d -u -v endif ifeq ($(shell uname),Darwin) @@ -57,14 +53,8 @@ uninstall: $(MAKE) -C launchd uninstall "DESTDIR=$(DESTDIR)"; \ fi -deps: - @# I am not sure if it is the correct way to keep the common library updated - $(GOGET_UPDATE) github.com/m13253/dns-over-https/doh-client/config - $(GOGET_UPDATE) github.com/m13253/dns-over-https/json-dns - $(GOGET) ./doh-client ./doh-server - -doh-client/doh-client: deps doh-client/client.go doh-client/config/config.go doh-client/google.go doh-client/ietf.go doh-client/main.go doh-client/version.go json-dns/error.go json-dns/globalip.go json-dns/marshal.go json-dns/response.go json-dns/unmarshal.go +doh-client/doh-client: doh-client/client.go doh-client/config/config.go doh-client/google.go doh-client/ietf.go doh-client/main.go doh-client/version.go json-dns/error.go json-dns/globalip.go json-dns/marshal.go json-dns/response.go json-dns/unmarshal.go cd doh-client && $(GOBUILD) -doh-server/doh-server: deps doh-server/config.go doh-server/google.go doh-server/ietf.go doh-server/main.go doh-server/server.go doh-server/version.go json-dns/error.go json-dns/globalip.go json-dns/marshal.go json-dns/response.go json-dns/unmarshal.go +doh-server/doh-server: doh-server/config.go doh-server/google.go doh-server/ietf.go doh-server/main.go doh-server/server.go doh-server/version.go json-dns/error.go json-dns/globalip.go json-dns/marshal.go json-dns/response.go json-dns/unmarshal.go cd doh-server && $(GOBUILD)