Commit 95523d43 authored by Janos Guljas's avatar Janos Guljas

add goreleaser GitHub Action and Dockerfile

parent 61f0e7f7
name: Release
on:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
key: ${{ secrets.YOUR_PRIVATE_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
/dist
/.idea
/.vscode
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof
.DS_Store
project_name: bee
builds:
- main: ./cmd/bee/main.go
binary: bee
flags:
- -v
- -trimpath
ldflags:
- -s -w -X github.com/janos/bee.version={{.Version}} -X github.com/janos/bee.commit={{.ShortCommit}}
env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
goarch:
- amd64
- 386
- arm64
- arm
ignore:
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm64
- goos: darwin
goarch: arm
- goos: windows
goarch: arm64
- goos: windows
goarch: arm
snapshot:
name_template: "{{.Tag}}-snapshot"
archives:
- name_template: "{{ tolower .ProjectName }}-{{ tolower .Os }}-{{ tolower .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format: binary
nfpms:
- file_name_template: "{{ tolower .ProjectName }}-{{ tolower .Os }}-{{ tolower .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
vendor: Ethereum Swarm
homepage: https://swarm.ethereum.org/
maintainer: Janoš Guljaš <janos@ethswarm.org>
description: Ethereum Swarm node
license: GPL-3
formats:
- deb
- rpm
bindir: /usr/bin
FROM golang AS builder
ADD . /src
WORKDIR /src
RUN make binary
FROM debian
RUN apt update && apt install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /src/dist/bee bee
RUN chmod +x ./bee
ENTRYPOINT ["./bee"]
GO ?= go
GOLANGCI_LINT ?= golangci-lint
LDFLAGS ?= -s -w -X github.com/janos/bee.commit="$(shell git describe --long --dirty --always --match "" || true)"
.PHONY: all
all: lint vet test binary
.PHONY: binary
binary: export CGO_ENABLED=0
binary: dist FORCE
$(GO) version
$(GO) build -trimpath -ldflags "$(LDFLAGS)" -o dist/bee ./cmd/bee
dist:
mkdir $@
.PHONY: lint
lint:
$(GOLANGCI_LINT) run
......@@ -16,4 +30,6 @@ test:
.PHONY: build
build: export CGO_ENABLED=0
build:
$(GO) build -trimpath -ldflags "-s -w" ./...
$(GO) build -trimpath -ldflags "$(LDFLAGS)" ./...
FORCE:
......@@ -5,38 +5,19 @@ go 1.13
require (
github.com/gogo/protobuf v1.3.1
github.com/gorilla/handlers v1.4.2
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/ipfs/go-log v1.0.1 // indirect
github.com/libp2p/go-conn-security v0.1.0 // indirect
github.com/libp2p/go-libp2p v0.5.0
github.com/libp2p/go-libp2p-autonat-svc v0.1.0
github.com/libp2p/go-libp2p-connmgr v0.2.1
github.com/libp2p/go-libp2p-core v0.3.0
github.com/libp2p/go-libp2p-crypto v0.1.0
github.com/libp2p/go-libp2p-host v0.1.0
github.com/libp2p/go-libp2p-interface-connmgr v0.1.0 // indirect
github.com/libp2p/go-libp2p-interface-pnet v0.1.0 // indirect
github.com/libp2p/go-libp2p-kad-dht v0.5.0
github.com/libp2p/go-libp2p-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-net v0.1.0 // indirect
github.com/libp2p/go-libp2p-protocol v0.1.0
github.com/libp2p/go-libp2p-quic-transport v0.2.2
github.com/libp2p/go-libp2p-routing v0.1.0
github.com/libp2p/go-libp2p-secio v0.2.1
github.com/libp2p/go-libp2p-tls v0.1.2
github.com/libp2p/go-libp2p-transport v0.1.0 // indirect
github.com/libp2p/go-stream-muxer v0.1.0 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/multiformats/go-multiaddr v0.2.0
github.com/multiformats/go-multistream v0.1.0
github.com/olekukonko/tablewriter v0.0.4
github.com/spf13/cobra v0.0.5
github.com/spf13/viper v1.6.1
github.com/whyrusleeping/go-smux-multiplex v3.0.16+incompatible // indirect
github.com/whyrusleeping/go-smux-multistream v2.0.2+incompatible // indirect
github.com/whyrusleeping/go-smux-yamux v2.0.9+incompatible // indirect
github.com/whyrusleeping/yamux v1.2.0 // indirect
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc
newreleases.io/cmd v0.1.0
newreleases.io/newreleases v1.3.1
resenje.org/web v0.4.0
)
This diff is collapsed.
package bee
// Version is a manually set semantic version number.
var Version = "v0.1.0-alpha"
var (
version = "v0.1.0" // manually set semantic version number
commit string // automatically set git commit hash
Version = func() string {
if commit != "" {
return version + "-" + commit
}
return version
}()
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment