From 7101fbd9c8405b7786425ac7e2f7ce956abe22da Mon Sep 17 00:00:00 2001 From: "Bo-Yi.Wu" Date: Sat, 24 Dec 2022 12:18:01 +0800 Subject: [PATCH] chore(CI): add binary build step in GitHub Actions https://github.com/appleboy/gorush/issues/704 Signed-off-by: Bo-Yi.Wu --- .github/workflows/build.yaml | 29 +++++++++++++++++++++++++++++ .github/workflows/go.yml | 7 +------ Makefile | 14 -------------- 3 files changed, 30 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..129dcd6 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,29 @@ +name: Release Binary + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Setup go + uses: actions/setup-go@v3 + with: + go-version: '^1' + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Build binary + run : | + make build_linux_amd64 + make build_linux_arm64 + make build_linux_arm + + - name: Check binary + run : | + ./release/linux/amd64/gorush --help diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3ff8fe1..56c7607 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,12 +1,7 @@ -name: Run Tests +name: Run Lint and Testing on: push: - branches: - - master - pull_request: - branches: - - master jobs: lint: diff --git a/Makefile b/Makefile index ae5f050..3a79c37 100644 --- a/Makefile +++ b/Makefile @@ -62,20 +62,6 @@ build: $(EXECUTABLE) $(EXECUTABLE): $(GOFILES) $(GO) build -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/$@ -.PHONY: misspell-check -misspell-check: - @hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - $(GO) install github.com/client9/misspell/cmd/misspell@v0.3.4; \ - fi - misspell -error $(GOFILES) - -.PHONY: misspell -misspell: - @hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - $(GO) install github.com/client9/misspell/cmd/misspell@v0.3.4; \ - fi - misspell -w $(GOFILES) - .PHONY: test test: init @$(GO) test -v -cover -tags $(TAGS) -coverprofile coverage.txt ./... && echo "\n==>\033[32m Ok\033[m\n" || exit 1