@@ -31,30 +31,49 @@ jobs:
31
31
fetch-depth : 0
32
32
33
33
- name : Calculate new version with autotag
34
+ id : autotag
34
35
run : |
35
36
curl -sL https://git.io/autotag-install | sh -s -- -b "${RUNNER_TEMP}/bin"
36
37
set -x
37
38
version=$(${RUNNER_TEMP}/bin/autotag -n)
38
- echo "version=$version" >> $GITHUB_ENV
39
+ echo "version=${version}" >> $GITHUB_ENV
40
+ echo "version=${version}" >> $GITHUB_OUTPUT
39
41
40
42
- name : Set up Docker Buildx
41
43
uses : docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3
42
44
43
- - name : Release
44
- run : |
45
- set -eou pipefail
46
- set -x
47
-
48
- image="ghcr.io/planetscale/k8s-node-tagger:v${version}"
45
+ - name : Cache
46
+ uses : actions/cache@v3
47
+ id : cache
48
+ with :
49
+ path : |
50
+ go-pkg-mod
51
+ go-build
52
+ key : ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}-v2
49
53
50
- git reset --hard && git clean -ffdx && git pull
54
+ - name : inject go caches into docker
55
+ uses :
reproducible-containers/[email protected]
56
+ with :
57
+ cache-map : |
58
+ {
59
+ "go-pkg-mod": "/go/pkg/mod",
60
+ "go-build": "/root/.cache/go-build"
61
+ }
62
+ skip-extraction : ${{ steps.cache.outputs.cache-hit }}
51
63
52
- docker buildx build \
53
- -t "$image" \
54
- --platform linux/amd64,linux/arm64 \
55
- --push \
56
- .
64
+ - name : Build and push
65
+ uses : docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5
66
+ with :
67
+ context : .
68
+ platforms : linux/amd64,linux/arm64
69
+ push : true
70
+ tags : ghcr.io/planetscale/k8s-node-tagger:v${{ steps.autotag.outputs.version }}
57
71
58
- gh release create "v${version}" --target main --title "v${version}" --generate-notes
72
+ - name : Create Release
59
73
env :
60
- GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
74
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75
+ run : |
76
+ gh release create "v${version}" \
77
+ --target main \
78
+ --title "v${version}" \
79
+ --generate-notes
0 commit comments