mirror of https://github.com/rkfg/regolancer
add goreleaser and dockerfile
add goreleaser decription add docker to READMEpull/46/head
parent
df27799b33
commit
200c42fe8b
@ -0,0 +1,126 @@
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
- go mod verify
|
||||
- go mod download
|
||||
|
||||
builds:
|
||||
- goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
- freebsd
|
||||
|
||||
goarch:
|
||||
- amd64
|
||||
- arm
|
||||
- arm64
|
||||
|
||||
goarm:
|
||||
- 6
|
||||
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
|
||||
binary: regolancer
|
||||
|
||||
checksum:
|
||||
name_template: '{{ tolower .ProjectName }}_{{.Version}}_checksums.txt'
|
||||
|
||||
snapshot:
|
||||
name_template: SNAPSHOT-{{ .Commit }}
|
||||
|
||||
archives:
|
||||
- name_template: "{{ tolower .ProjectName }}_{{.Version}}_{{.Os}}-{{.Arch}}"
|
||||
replacements:
|
||||
darwin: macOS
|
||||
linux: Linux
|
||||
windows: Windows
|
||||
freebsd: FreeBSD
|
||||
|
||||
files:
|
||||
- LICENSE
|
||||
- README.md
|
||||
- CHANGELOG.md
|
||||
- config.toml.sample
|
||||
- config.json.sample
|
||||
|
||||
format: tar.gz
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
|
||||
changelog:
|
||||
# Set this to true if you don't want any changelog at all.
|
||||
# Warning: this will also ignore any changelog files passed via `--release-notes`,
|
||||
# and will render an empty changelog.
|
||||
# This may result in an empty release notes on GitHub/GitLab/Gitea.
|
||||
skip: false
|
||||
|
||||
# dockers:
|
||||
# # https://goreleaser.com/customization/docker/
|
||||
# - use: buildx
|
||||
# goos: linux
|
||||
# goarch: amd64
|
||||
# image_templates:
|
||||
# - "ziggie1984/{{ .ProjectName }}:{{ .Version }}-amd64"
|
||||
# - "ziggie1984/{{ .ProjectName }}:latest-amd64"
|
||||
# build_flag_templates:
|
||||
# - "--platform=linux/amd64"
|
||||
# - "--label=org.opencontainers.image.created={{.Date}}"
|
||||
# - "--label=org.opencontainers.image.title={{.ProjectName}}"
|
||||
# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
# - "--label=org.opencontainers.image.version={{.Version}}"
|
||||
# - use: buildx
|
||||
# goos: linux
|
||||
# goarch: arm64
|
||||
# image_templates:
|
||||
# - "ziggie1984/{{ .ProjectName }}:{{ .Version }}-arm64v8"
|
||||
# - "ziggie1984/{{ .ProjectName }}:latest-arm64v8"
|
||||
# build_flag_templates:
|
||||
# - "--platform=linux/arm64/v8"
|
||||
# - "--label=org.opencontainers.image.created={{.Date}}"
|
||||
# - "--label=org.opencontainers.image.title={{.ProjectName}}"
|
||||
# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
# - "--label=org.opencontainers.image.version={{.Version}}"
|
||||
# - use: buildx
|
||||
# goos: linux
|
||||
# goarch: arm
|
||||
# goarm: 6
|
||||
# image_templates:
|
||||
# - "ziggie1984/{{ .ProjectName }}:{{ .Version }}-armv6"
|
||||
# - "ziggie1984/{{ .ProjectName }}:latest-armv6"
|
||||
# build_flag_templates:
|
||||
# - "--platform=linux/arm/v6"
|
||||
# - "--label=org.opencontainers.image.created={{.Date}}"
|
||||
# - "--label=org.opencontainers.image.title={{.ProjectName}}"
|
||||
# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
# - "--label=org.opencontainers.image.version={{.Version}}"
|
||||
# - use: buildx
|
||||
# goos: linux
|
||||
# goarch: arm
|
||||
# goarm: 7
|
||||
# image_templates:
|
||||
# - "ziggie1984/{{ .ProjectName }}:{{ .Version }}-armv7"
|
||||
# - "ziggie1984/{{ .ProjectName }}:latest-armv7"
|
||||
# build_flag_templates:
|
||||
# - "--platform=linux/arm/v7"
|
||||
# - "--label=org.opencontainers.image.created={{.Date}}"
|
||||
# - "--label=org.opencontainers.image.title={{.ProjectName}}"
|
||||
# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
# - "--label=org.opencontainers.image.version={{.Version}}"
|
||||
|
||||
# docker_manifests:
|
||||
# # https://goreleaser.com/customization/docker_manifest/
|
||||
# - name_template: ziggie1984/{{ .ProjectName }}:{{ .Version }}
|
||||
# image_templates:
|
||||
# - ziggie1984/{{ .ProjectName }}:{{ .Version }}-amd64
|
||||
# - ziggie1984/{{ .ProjectName }}:{{ .Version }}-arm64v8
|
||||
# - ziggie1984/{{ .ProjectName }}:{{ .Version }}-armv6
|
||||
# - ziggie1984/{{ .ProjectName }}:{{ .Version }}-armv7
|
||||
# - name_template: ziggie1984/{{ .ProjectName }}:latest
|
||||
# image_templates:
|
||||
# - ziggie1984/{{ .ProjectName }}:latest-amd64
|
||||
# - ziggie1984/{{ .ProjectName }}:latest-arm64v8
|
||||
# - ziggie1984/{{ .ProjectName }}:latest-armv6
|
||||
# - ziggie1984/{{ .ProjectName }}:latest-armv7
|
@ -0,0 +1,38 @@
|
||||
FROM golang:1.19.2-alpine as builder
|
||||
|
||||
|
||||
# Pass a tag, branch or a commit using build-arg. This allows a docker
|
||||
# image to be built from a specified Git state. The default image
|
||||
# will use the Git tip of master by default.
|
||||
ARG checkout="master"
|
||||
ARG git_url="https://github.com/rkfg/regolancer.git"
|
||||
|
||||
|
||||
# Install dependencies and build the binaries.
|
||||
RUN apk add --no-cache git \
|
||||
&& git clone $git_url /go/src/github.com/regolancer \
|
||||
&& cd /go/src/github.com/regolancer \
|
||||
&& git checkout $checkout \
|
||||
&& go install
|
||||
|
||||
|
||||
# Start a new, final image.
|
||||
FROM alpine as final
|
||||
|
||||
|
||||
RUN apk --no-cache add \
|
||||
bash \
|
||||
jq
|
||||
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /go/bin/regolancer /app
|
||||
|
||||
|
||||
|
||||
|
||||
VOLUME [ "/root/.lnd" ]
|
||||
|
||||
ENTRYPOINT ["./regolancer"]
|
||||
|
@ -0,0 +1,33 @@
|
||||
# How to Create Releases with goreleaser
|
||||
|
||||
Before you can use goreleaser you first need to install it: https://goreleaser.com/install/
|
||||
|
||||
In case you want to create a test release just create a snapshot build with:
|
||||
|
||||
`goreleaser release --snapshot --rm-dist`
|
||||
|
||||
This will only create a release version locally.
|
||||
|
||||
One can only build all the target or only one specific target:
|
||||
|
||||
`GOOS=linux GOARCH=amd64 goreleaser build --rm-dist`
|
||||
|
||||
Currently the CHANGE.LOG of the goreleaser is enabled to remove it go to the `.goreleaser.yaml` and change the setting.
|
||||
|
||||
If you verified that the snapshot version is good to go than you can create a final release
|
||||
|
||||
First you need to get a github token with at least the privilige of write:packages
|
||||
|
||||
`export GITHUB_TOKEN="YOUR_GH_TOKEN"`
|
||||
|
||||
detailed information how to create a release with a speicific tag can be found here: https://goreleaser.com/quick-start/
|
||||
|
||||
```
|
||||
git tag -a v0.1.0 -m "Release Comment"
|
||||
|
||||
goreleaser release
|
||||
|
||||
```
|
||||
|
||||
Currently Docker Releases are turned off, but can be decided otherwise
|
||||
|
Loading…
Reference in New Issue