1- on : [push, pull_request]
21name : CI
2+ on :
3+ pull_request : {}
4+ push : {}
5+ permissions : write-all
36jobs :
47 # ================
5- # TEST JOB
6- # runs on every push and PR
7- # runs 2x3 times (see matrix)
8+ # BUILD AND TEST JOB
89 # ================
910 test :
10- name : Test
11+ name : Build & Test
1112 strategy :
1213 matrix :
13- go-version : [1.21.x]
14+ # optionally test/build across multiple platforms/Go-versions
15+ go-version : ['1.22'] # '1.16', '1.17', '1.18,
1416 platform : [ubuntu-latest, macos-latest, windows-latest]
1517 runs-on : ${{ matrix.platform }}
1618 steps :
17- - name : Install Go
18- uses : actions/setup-go@v5
19+ - name : Checkout
20+ uses : actions/checkout@v3
21+ with :
22+ fetch-depth : 0
23+ - name : Set up Go
24+ uses : actions/setup-go@v3
1925 with :
2026 go-version : ${{ matrix.go-version }}
21- - name : Checkout code
22- uses : actions/checkout@v3
27+ check-latest : true
2328 - name : Build
2429 run : go build -v -o /dev/null .
2530 - name : Test
2631 run : go test -v ./...
2732 # ================
28- # RELEASE JOBS
29- # runs after a success test
30- # only runs on push "v*" tag
33+ # RELEASE BINARIES (on push "v*" tag)
3134 # ================
3235 release_binaries :
3336 name : Release Binaries
4144 if : success()
4245 uses : docker://goreleaser/goreleaser:latest
4346 env :
47+ GITHUB_USER : ${{ github.repository_owner }}
4448 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4549 with :
4650 args : release --config .github/goreleaser.yml
51+ # ================
52+ # RELEASE DOCKER IMAGES (on push "v*" tag)
53+ # ================
4754 release_docker :
4855 name : Release Docker Images
4956 needs : test
@@ -53,17 +60,16 @@ jobs:
5360 - name : Check out code
5461 uses : actions/checkout@v3
5562 - name : Set up QEMU
56- uses : docker/setup-qemu-action@v1
63+ uses : docker/setup-qemu-action@v2
5764 - name : Set up Docker Buildx
58- id : buildx
59- uses : docker/setup-buildx-action@v1
65+ uses : docker/setup-buildx-action@v2
6066 - name : Login to DockerHub
6167 uses : docker/login-action@v2
6268 with :
6369 username : jpillora
6470 password : ${{ secrets.DOCKERHUB_TOKEN }}
6571 - name : Docker meta
66- id : docker_meta
72+ id : meta
6773 uses : docker/metadata-action@v4
6874 with :
6975 images : jpillora/chisel
7480 - name : Build and push
7581 uses : docker/build-push-action@v3
7682 with :
77- context : .
83+ file : .github/Dockerfile
7884 platforms : linux/amd64,linux/arm64,linux/ppc64le,linux/386,linux/arm/v7,linux/arm/v6
7985 push : true
80- tags : ${{ steps.docker_meta.outputs.tags }}
81- labels : ${{ steps.docker_meta.outputs.labels }}
86+ tags : ${{ steps.meta.outputs.tags }}
87+ labels : ${{ steps.meta.outputs.labels }}
88+ cache-from : type=gha
89+ cache-to : type=gha,mode=max
0 commit comments