Skip to content

Commit

Permalink
build(evrys): add dockerfile and goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaba505 committed Oct 13, 2022
1 parent 1c7efbe commit 19d8c69
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 2 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ name: main
on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]

jobs:
permissions:
contents: write
packages: write

jobs:
build:
runs-on: ubuntu-latest
steps:
Expand All @@ -23,3 +28,12 @@ jobs:

- name: Test
run: go test -v -race -cover ./...

- uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Goreleaser
dist/

# Terraform
# Local .terraform directories
**/.terraform/*
Expand Down Expand Up @@ -36,4 +39,4 @@ terraform.rc

# Editors
.vscode
.idea
.idea
32 changes: 32 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
dockers:
- image_templates:
- "ghcr.io/z5labs/evrys/evrys:{{ .Tag }}"
- "ghcr.io/z5labs/evrys/evrys:latest"
archives:
- replacements:
darwin: darwin
linux: linux
windows: windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2022 Z5Labs and Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.19

ADD evrys .

ENTRYPOINT [ "./evrys" ]

0 comments on commit 19d8c69

Please sign in to comment.