Skip to content

Commit

Permalink
Add setups for Golang and QEMU
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed May 4, 2021
1 parent 978cd60 commit 6308f15
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- name: Docker Buildx
uses: docker/setup-buildx-action@v1
with:
Expand All @@ -60,6 +64,10 @@ jobs:
${{ runner.os }}-buildx-
- name: Determine GOPATH
run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
- name: Setup Golang Environment
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
Expand All @@ -68,6 +76,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: ${{ env.GOPATH }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm,arm64,ppc64le,s390x,mips64le,386
- name: Build Image
uses: docker/build-push-action@v2
with:
Expand All @@ -91,9 +103,17 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Retrieve Tag
id: get_version
run: echo ::set-output name=GIT_TAG::$(echo ${GITHUB_REF/refs\/tags\//} | tr -d v)
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- name: Setup Golang Environment
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Docker Buildx
uses: docker/setup-buildx-action@v1
with:
Expand Down Expand Up @@ -124,6 +144,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: ${{ env.GOPATH }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm,arm64,ppc64le,s390x,mips64le,386
- name: Push to Dockerhub
uses: docker/build-push-action@v2
with:
Expand Down

0 comments on commit 6308f15

Please sign in to comment.