Skip to content

Commit

Permalink
update build pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuf Kanchwala committed Jul 1, 2021
1 parent c59eea8 commit 9442c25
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 117 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/gobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ jobs:
- name: Login to docker hub
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u accurics --password-stdin

- name: Push Terrascan docker image
run: make docker-push

- name: Push Terrascan latest docker image
if: ${{ github.ref == 'refs/heads/master' }}
run: make docker-push-latest
31 changes: 18 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,36 @@ on:
jobs:
release:
runs-on: ubuntu-latest
env:
GO111MODULE: on
GO_VERSION: 1.16
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run Main GoReleaser
run: docker run -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} --rm -v $GITHUB_WORKSPACE:/go/src/github.com/accurics/terrascan -w /go/src/github.com/accurics/terrascan neilotoole/xcgo bash -c "apt update; apt install -y gcc-multilib; goreleaser release --rm-dist -f .goreleaser.yml"
# arm64 build disabled for now while we work through some package conflicts between gcc-multilib and gcc-aarch64-linux-gnu
# - name: Run GoReleaser for arm64
# run: docker run -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} --rm -v $GITHUB_WORKSPACE:/go/src/github.com/accurics/terrascan -w /go/src/github.com/accurics/terrascan neilotoole/xcgo bash -c "apt update; apt install -y gcc-aarch64-linux-gnu; rm -rf /go/src/github.com/accurics/terrascan/dist ; goreleaser release --rm-dist -f .goreleaser-arm64.yml"
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# push image to Docker Hub
push:
runs-on: ubuntu-latest

steps:
- name: Checkout Terrascan
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Build Terrascan docker image
run: make docker-build
Expand All @@ -35,10 +46,4 @@ jobs:
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u accurics --password-stdin

- name: Push Terrascan latest tag docker image
run: make docker-push-latest-tag

- name: Build terrascan_atlantis docker image
run: make atlantis-docker-build

- name: Push terrascan_atlantis latest tag docker image
run: make atlantis-docker-push-latest-tag
run: make docker-push-latest-tag
42 changes: 0 additions & 42 deletions .goreleaser-arm64.yml

This file was deleted.

63 changes: 4 additions & 59 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,13 @@ before:
# you may remove this if you don't need go generate
- go generate ./...
builds:
- binary: terrascan
id: terrascan_linux_amd64
main: ./cmd/terrascan/main.go
ldflags: -s -w -extldflags=-static
env:
- CGO_ENABLED=1
flags:
- -buildmode
- exe
- -tags
- extended
- env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- binary: terrascan
id: terrascan_linux_386
main: ./cmd/terrascan/main.go
ldflags: -s -w -extldflags=-static
env:
- CGO_ENABLED=1
flags:
- -buildmode
- exe
- -tags
- extended
goos:
- linux
goarch:
- 386
- binary: terrascan
id: terrascan_darwin
main: ./cmd/terrascan/main.go
ldflags: -s -w
env:
- CGO_ENABLED=1
- CC=o64-clang
flags:
- -buildmode
- exe
- -tags
- extended
goos:
- windows
- darwin
goarch:
- amd64
- binary: terrascan
id: terrascan_windows
main: ./cmd/terrascan/main.go
ldflags: -s -w
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
flags:
- -buildmode
- exe
- -tags
- extended
goos:
- windows
goarch:
- amd64
archives:
- replacements:
darwin: Darwin
Expand All @@ -85,4 +30,4 @@ changelog:
filters:
exclude:
- '^docs:'
- '^test:'
- '^test:'

0 comments on commit 9442c25

Please sign in to comment.