move goreleaser to makefile

This commit is contained in:
Alex Goodman 2019-11-20 12:19:17 -08:00
parent ba307fb811
commit 74be19bf98
No known key found for this signature in database
GPG Key ID: 150587AB82D3C4E6
2 changed files with 21 additions and 10 deletions

View File

@ -43,8 +43,10 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Install go tools - name: Install tooling
run: make ci-install-go-tools run: |
make ci-install-go-tools
make ci-install-ci-tools
- name: Cache go dependencies - name: Cache go dependencies
id: package-cache-go-dependencies id: package-cache-go-dependencies
@ -62,10 +64,7 @@ jobs:
run: make ci-static-analyses run: make ci-static-analyses
- name: Build snapshot artifacts - name: Build snapshot artifacts
uses: goreleaser/goreleaser-action@v1 run: make ci-build-snapshot-packages
with:
version: latest
args: release --snapshot --skip-publish --rm-dist
- run: docker images wagoodman/dive - run: docker images wagoodman/dive
@ -145,6 +144,9 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Install tooling
run: make ci-install-ci-tools
- name: Cache go dependencies - name: Cache go dependencies
id: release-cache-go-dependencies id: release-cache-go-dependencies
uses: actions/cache@v1 uses: actions/cache@v1
@ -164,10 +166,7 @@ jobs:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish GitHub release - name: Publish GitHub release
uses: goreleaser/goreleaser-action@v1 run: make ci-release
with:
version: "v0.123.0"
args: release --rm-dist
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -21,6 +21,9 @@ ci-static-analyses:
ci-install-go-tools: ci-install-go-tools:
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sudo sh -s -- -b /usr/local/bin/ latest curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sudo sh -s -- -b /usr/local/bin/ latest
ci-install-ci-tools:
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sudo sh -s -- -b /usr/local/bin/ "v0.122.0"
ci-docker-login: ci-docker-login:
echo '${DOCKER_PASSWORD}' | docker login -u '${DOCKER_USERNAME}' --password-stdin '${PRODUCTION_REGISTRY}' echo '${DOCKER_PASSWORD}' | docker login -u '${DOCKER_USERNAME}' --password-stdin '${PRODUCTION_REGISTRY}'
@ -30,6 +33,15 @@ ci-docker-logout:
ci-publish-release: ci-publish-release:
goreleaser --rm-dist goreleaser --rm-dist
ci-build-snapshot-packages:
goreleaser \
--snapshot \
--skip-publish \
--rm-dist
ci-release:
release --rm-dist
# todo: add --pull=never when supported by host box # todo: add --pull=never when supported by host box
ci-test-production-image: ci-test-production-image:
docker run \ docker run \