Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
add CI releases with docker image (#57)
Browse files Browse the repository at this point in the history
* add ci releases

* fix version

* add docker login and configure to run for realsies on tag pushes
  • Loading branch information
gbrik authored Apr 16, 2020
1 parent a855a1f commit f73ee8e
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release

on:
push:
tags:
- v*

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.14.x
-
name: Docker login
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: v0.131.1
args: release --rm-dist
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
project_name: lsif-go

dist: release

env:
- GO111MODULE=on
- CGO_ENABLED=0

before:
hooks:
- go mod download
- go mod tidy

builds:
-
main: ./cmd/lsif-go/
binary: lsif-go
ldflags:
- -X main.buildTag={{.Version}}
goos:
- linux
- windows
- darwin
goarch:
- amd64

archives:
- id: tarball
format: tar.gz
- id: bin
format: binary
wrap_in_directory: false
name_template: "src_{{ .Os }}_{{ .Arch }}"

dockers:
- binaries:
- lsif-go
image_templates:
- "sourcegraph/lsif-go:{{ .Tag }}"
- "sourcegraph/lsif-go:v{{ .Major }}"
- "sourcegraph/lsif-go:v{{ .Major }}.{{ .Minor }}"
- "sourcegraph/lsif-go:latest"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM sourcegraph/alpine:3.10

COPY lsif-go /usr/bin/
ENTRYPOINT ["/usr/bin/lsif-go"]

0 comments on commit f73ee8e

Please sign in to comment.