@@ -3,7 +3,7 @@ name: Upload Release Asset
3
3
on :
4
4
push :
5
5
tags :
6
- - ' v* '
6
+ - " v* "
7
7
env :
8
8
IMAGE_NAME : cluster-api-provider-packet
9
9
GHCR_REGISTRY : ghcr.io/${{ github.repository_owner }}
12
12
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
13
13
14
14
jobs :
15
-
16
15
build-image :
17
16
name : Build and Push Image
18
17
runs-on : ubuntu-latest
@@ -21,78 +20,77 @@ jobs:
21
20
packages : write # needed to push docker image to ghcr.io
22
21
23
22
steps :
24
-
25
- - name : Checkout git repo
26
- uses : actions/checkout@v4
27
-
28
- - name : Set up QEMU
29
- uses : docker/setup-qemu-action@v3
30
-
31
- - name : Set up Docker Buildx
32
- uses : docker/setup-buildx-action@v3
33
-
34
- - name : Login to ghcr.io registry
35
- uses : docker/login-action@v3
36
- with :
37
- registry : ghcr.io
38
- username : ${{ github.actor }}
39
- password : ${{ secrets.GITHUB_TOKEN }}
40
-
41
- - name : Log into DockerHub
42
- uses : docker/login-action@v3
43
- env :
44
- DOCKER_USERNAME : ${{ secrets.DOCKER_USERNAME }}
45
- if : ${{ env.DOCKER_USERNAME != '' }}
46
- with :
47
- username : ${{ secrets.DOCKER_USERNAME }}
48
- password : ${{ secrets.DOCKER_PASSWORD }}
49
-
50
- - name : Log into quay.io
51
- uses : docker/login-action@v3
52
- env :
53
- QUAY_USERNAME : ${{ secrets.QUAY_USERNAME }}
54
- if : ${{ env.QUAY_USERNAME != '' }}
55
- with :
56
- registry : quay.io
57
- username : ${{ secrets.QUAY_USERNAME }}
58
- password : ${{ secrets.QUAY_PASSWORD }}
59
-
60
- - name : Docker meta
61
- id : docker_meta
62
- uses : docker/metadata-action@v5
63
- with :
64
- images : |
65
- ${{ env.QUAY_REGISTRY }}/${{ env.IMAGE_NAME }}
66
- ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
67
- ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}
68
- flavor : |
69
- latest=auto
70
- tags : |
23
+ - name : Checkout git repo
24
+ uses : actions/checkout@v4
25
+
26
+ - name : Set up QEMU
27
+ uses : docker/setup-qemu-action@v3
28
+
29
+ - name : Set up Docker Buildx
30
+ uses : docker/setup-buildx-action@v3
31
+
32
+ - name : Login to ghcr.io registry
33
+ uses : docker/login-action@v3
34
+ with :
35
+ registry : ghcr.io
36
+ username : ${{ github.actor }}
37
+ password : ${{ secrets.GITHUB_TOKEN }}
38
+
39
+ - name : Log into DockerHub
40
+ uses : docker/login-action@v3
41
+ env :
42
+ DOCKER_USERNAME : ${{ secrets.DOCKER_USERNAME }}
43
+ if : ${{ env.DOCKER_USERNAME != '' }}
44
+ with :
45
+ username : ${{ secrets.DOCKER_USERNAME }}
46
+ password : ${{ secrets.DOCKER_PASSWORD }}
47
+
48
+ - name : Log into quay.io
49
+ uses : docker/login-action@v3
50
+ env :
51
+ QUAY_USERNAME : ${{ secrets.QUAY_USERNAME }}
52
+ if : ${{ env.QUAY_USERNAME != '' }}
53
+ with :
54
+ registry : quay.io
55
+ username : ${{ secrets.QUAY_USERNAME }}
56
+ password : ${{ secrets.QUAY_PASSWORD }}
57
+
58
+ - name : Docker meta
59
+ id : docker_meta
60
+ uses : docker/metadata-action@v5
61
+ with :
62
+ images : |
63
+ ${{ env.QUAY_REGISTRY }}/${{ env.IMAGE_NAME }}
64
+ ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
65
+ ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}
66
+ flavor : |
67
+ latest=auto
68
+ tags : |
71
69
type=semver,pattern={{version}}
72
70
type=ref,event=branch
73
71
type=ref,event=tag
74
72
type=ref,event=pr
75
73
type=sha
76
74
77
- - name : Setup Env
78
- run : |
79
- DOCKER_BUILD_LDFLAGS="$(hack/version.sh)"
80
- echo 'DOCKER_BUILD_LDFLAGS<<EOF' >> $GITHUB_ENV
81
- echo $DOCKER_BUILD_LDFLAGS >> $GITHUB_ENV
82
- echo 'EOF' >> $GITHUB_ENV
83
-
84
- - name : Docker Build and Push
85
- uses : docker/build-push-action@v5
86
- with :
87
- context : .
88
- push : true
89
- build-args : |
90
- LDFLAGS=${{ env.DOCKER_BUILD_LDFLAGS }}
91
- tags : ${{ steps.docker_meta.outputs.tags }}
92
- labels : ${{ steps.docker_meta.outputs.labels }}
93
- cache-from : type=gha
94
- cache-to : type=gha,mode=max
95
- platforms : linux/amd64, linux/arm64, linux/arm/v7
75
+ - name : Setup Env
76
+ run : |
77
+ DOCKER_BUILD_LDFLAGS="$(hack/version.sh)"
78
+ echo 'DOCKER_BUILD_LDFLAGS<<EOF' >> $GITHUB_ENV
79
+ echo $DOCKER_BUILD_LDFLAGS >> $GITHUB_ENV
80
+ echo 'EOF' >> $GITHUB_ENV
81
+
82
+ - name : Docker Build and Push
83
+ uses : docker/build-push-action@v5
84
+ with :
85
+ context : .
86
+ push : true
87
+ build-args : |
88
+ LDFLAGS=${{ env.DOCKER_BUILD_LDFLAGS }}
89
+ tags : ${{ steps.docker_meta.outputs.tags }}
90
+ labels : ${{ steps.docker_meta.outputs.labels }}
91
+ cache-from : type=gha
92
+ cache-to : type=gha,mode=max
93
+ platforms : linux/amd64, linux/arm64
96
94
97
95
outputs :
98
96
image-tag : " ${{ steps.docker_meta.outputs.version }}"
@@ -106,33 +104,32 @@ jobs:
106
104
REGISTRY : quay.io/${{ secrets.QUAY_ORG }}
107
105
108
106
steps :
109
-
110
- - name : checkout
111
- uses : actions/checkout@v4
112
-
113
- - uses : actions/setup-go@v4
114
- with :
115
- go-version-file : ' ./go.mod'
116
-
117
- - name : Make Release
118
- run : make release
119
-
120
- - name : Generate Release Notes
121
- run : |
122
- release_notes=$(gh api repos/{owner}/{repo}/releases/generate-notes -F tag_name=${{ github.ref }} --jq .body)
123
- echo 'RELEASE_NOTES<<EOF' >> $GITHUB_ENV
124
- echo "${release_notes}" >> $GITHUB_ENV
125
- echo 'EOF' >> $GITHUB_ENV
126
- env :
127
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
128
- OWNER : ${{ github.repository_owner }}
129
- REPO : ${{ github.event.repository.name }}
130
-
131
- - name : Create Release
132
- uses : softprops/action-gh-release@v1
133
- if : startsWith(github.ref, 'refs/tags/')
134
- with :
135
- files : out/release/*
136
- body : ${{ env.RELEASE_NOTES }}
137
- draft : false
138
- prerelease : false
107
+ - name : checkout
108
+ uses : actions/checkout@v4
109
+
110
+ - uses : actions/setup-go@v4
111
+ with :
112
+ go-version-file : " ./go.mod"
113
+
114
+ - name : Make Release
115
+ run : make release
116
+
117
+ - name : Generate Release Notes
118
+ run : |
119
+ release_notes=$(gh api repos/{owner}/{repo}/releases/generate-notes -F tag_name=${{ github.ref }} --jq .body)
120
+ echo 'RELEASE_NOTES<<EOF' >> $GITHUB_ENV
121
+ echo "${release_notes}" >> $GITHUB_ENV
122
+ echo 'EOF' >> $GITHUB_ENV
123
+ env :
124
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
125
+ OWNER : ${{ github.repository_owner }}
126
+ REPO : ${{ github.event.repository.name }}
127
+
128
+ - name : Create Release
129
+ uses : softprops/action-gh-release@v1
130
+ if : startsWith(github.ref, 'refs/tags/')
131
+ with :
132
+ files : out/release/*
133
+ body : ${{ env.RELEASE_NOTES }}
134
+ draft : false
135
+ prerelease : false
0 commit comments