9 | 9 |
name: Test
|
10 | 10 |
strategy:
|
11 | 11 |
matrix:
|
12 | |
go-version: [1.13.x, 1.14.x, 1.15.x]
|
|
12 |
go-version: [1.13.x, 1.14.x, 1.15.x, 1.16.x]
|
13 | 13 |
platform: [ubuntu-latest, macos-latest, windows-latest]
|
14 | 14 |
runs-on: ${{ matrix.platform }}
|
15 | 15 |
steps:
|
16 | 16 |
- name: Install Go
|
17 | |
uses: actions/setup-go@v1
|
|
17 |
uses: actions/[email protected]
|
18 | 18 |
with:
|
19 | 19 |
go-version: ${{ matrix.go-version }}
|
20 | 20 |
- name: Checkout code
|
|
26 | 26 |
env:
|
27 | 27 |
GODEBUG: x509ignoreCN=0
|
28 | 28 |
# ================
|
29 | |
# RELEASE JOB
|
|
29 |
# RELEASE JOBS
|
30 | 30 |
# runs after a success test
|
31 | 31 |
# only runs on push "v*" tag
|
32 | 32 |
# ================
|
33 | |
release:
|
34 | |
name: Release
|
|
33 |
release_binaries:
|
|
34 |
name: Release Binaries
|
35 | 35 |
needs: test
|
36 | 36 |
if: startsWith(github.ref, 'refs/tags/v')
|
37 | 37 |
runs-on: ubuntu-latest
|
|
45 | 45 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
46 | 46 |
with:
|
47 | 47 |
args: release --config .github/goreleaser.yml
|
|
48 |
release_docker:
|
|
49 |
name: Release Docker Images
|
|
50 |
needs: test
|
|
51 |
if: startsWith(github.ref, 'refs/tags/v')
|
|
52 |
runs-on: ubuntu-latest
|
|
53 |
steps:
|
|
54 |
- name: Check out code
|
|
55 |
uses: actions/checkout@v2
|
|
56 |
- name: Set up QEMU
|
|
57 |
uses: docker/setup-qemu-action@v1
|
|
58 |
- name: Set up Docker Buildx
|
|
59 |
id: buildx
|
|
60 |
uses: docker/setup-buildx-action@v1
|
|
61 |
- name: Login to DockerHub
|
|
62 |
uses: docker/login-action@v1
|
|
63 |
with:
|
|
64 |
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
65 |
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
66 |
- name: Docker meta
|
|
67 |
id: docker_meta
|
|
68 |
uses: crazy-max/ghaction-docker-meta@v1
|
|
69 |
with:
|
|
70 |
images: jpillora/chisel
|
|
71 |
tag-latest: true
|
|
72 |
# Outputs:
|
|
73 |
# jpillora/chisel:1.2.3
|
|
74 |
# jpillora/chisel:1.2
|
|
75 |
# jpillora/chisel:1
|
|
76 |
# jpillora/chisel:latest
|
|
77 |
tag-semver: |
|
|
78 |
{{version}}
|
|
79 |
{{major}}.{{minor}}
|
|
80 |
{{major}}
|
|
81 |
- name: Build and push
|
|
82 |
uses: docker/build-push-action@v2
|
|
83 |
with:
|
|
84 |
context: .
|
|
85 |
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/386,linux/arm/v7,linux/arm/v6
|
|
86 |
push: true
|
|
87 |
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
88 |
labels: ${{ steps.docker_meta.outputs.labels }}
|