Skip to content

Commit

Permalink
Merge pull request #2 from banviktor/binary-builder-workflow
Browse files Browse the repository at this point in the history
Update GitHub workflows
  • Loading branch information
viktb authored May 15, 2023
2 parents f54b342 + bb83716 commit 40cd772
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build-binaries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build and upload binaries
on:
push:
tags:
- v*
jobs:
build_and_archive:
name: Build
runs-on: ubuntu-22.04
container:
image: golang:1.20-alpine
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: apk add --no-cache make
- name: Build
run: make release-all
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: binaries
path: asnlookup-*.tar.gz
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: CI
on:
push:
branches:
Expand All @@ -7,9 +7,9 @@ on:
jobs:
build:
name: Build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: golang:1.16-alpine
image: golang:1.20-alpine
steps:
- uses: actions/checkout@v2
- name: Install dependencies
Expand All @@ -18,9 +18,9 @@ jobs:
run: make
test:
name: Test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: golang:1.16-alpine
image: golang:1.20-alpine
steps:
- uses: actions/checkout@v2
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ deps:
go mod download

$(BUILDDIR)/asnlookup: deps
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(BUILDDIR)/asnlookup ./cmd/asnlookup
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags '-extldflags "-static"' -o $(BUILDDIR)/asnlookup ./cmd/asnlookup

$(BUILDDIR)/asnlookup-utils: deps
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(BUILDDIR)/asnlookup-utils ./cmd/asnlookup-utils
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags '-extldflags "-static"' -o $(BUILDDIR)/asnlookup-utils ./cmd/asnlookup-utils

.PHONY: release
release:
Expand Down

0 comments on commit 40cd772

Please sign in to comment.