Skip to content

Commit a4656a8

Browse files
authored
Add setups for Golang and QEMU (#187)
1 parent 978cd60 commit a4656a8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ jobs:
4747
steps:
4848
- name: Checkout Repository
4949
uses: actions/checkout@v2
50+
with:
51+
fetch-depth: 0
52+
- name: Determine Go version from go.mod
53+
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
54+
- name: Setup QEMU
55+
uses: docker/setup-qemu-action@v1
56+
with:
57+
platforms: arm,arm64,ppc64le,s390x,mips64le,386
5058
- name: Docker Buildx
5159
uses: docker/setup-buildx-action@v1
5260
with:
@@ -60,6 +68,10 @@ jobs:
6068
${{ runner.os }}-buildx-
6169
- name: Determine GOPATH
6270
run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
71+
- name: Setup Golang Environment
72+
uses: actions/setup-go@v2
73+
with:
74+
go-version: ${{ env.GO_VERSION }}
6375
- name: Run GoReleaser
6476
uses: goreleaser/goreleaser-action@v2
6577
with:
@@ -91,9 +103,21 @@ jobs:
91103
steps:
92104
- name: Checkout Repository
93105
uses: actions/checkout@v2
106+
with:
107+
fetch-depth: 0
94108
- name: Retrieve Tag
95109
id: get_version
96110
run: echo ::set-output name=GIT_TAG::$(echo ${GITHUB_REF/refs\/tags\//} | tr -d v)
111+
- name: Determine Go version from go.mod
112+
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
113+
- name: Setup Golang Environment
114+
uses: actions/setup-go@v2
115+
with:
116+
go-version: ${{ env.GO_VERSION }}
117+
- name: Setup QEMU
118+
uses: docker/setup-qemu-action@v1
119+
with:
120+
platforms: arm,arm64,ppc64le,s390x,mips64le,386
97121
- name: Docker Buildx
98122
uses: docker/setup-buildx-action@v1
99123
with:

0 commit comments

Comments
 (0)