2626 steps :
2727
2828 - name : Checkout repository
29- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
30- # https://github.com/actions/checkout/releases/tag/v4.1.1
29+ uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3130
32- - name : Setup Go
33- uses : actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
34- # https://github.com/actions/setup-go/releases/tag/v5.0.0
35- with :
36- go-version-file : ' go.mod'
37-
38- - name : Build and package
31+ - name : Build Binary
3932 run : |
4033 ./scripts/build
4134 mkdir -p dist/artifacts
4437 ARCH : " ${{ matrix.arch}}"
4538 GOARCH : " ${{ matrix.arch}}"
4639
47- - name : Generate checksum files
40+ - name : Prepare Artifacts
4841 run : |
49- ls -lR dist
5042 cd dist/artifacts
5143 sha256sum webhook-linux-${{ matrix.arch }} > sha256sum-${{ matrix.arch }}.txt
5244
@@ -67,10 +59,10 @@ jobs:
6759
6860 - name : Checkout repository
6961 # https://github.com/actions/checkout/releases/tag/v4.1.1
70- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
62+ uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
7163
7264 - name : package-helm
73- run : ./scripts/ package-helm
65+ run : make package-helm
7466
7567 - name : Download the amd64 artifacts
7668 uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
@@ -116,27 +108,6 @@ jobs:
116108 # https://github.com/actions/checkout/releases/tag/v4.1.1
117109 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
118110
119- - name : Download the artifacts
120- uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
121- # https://github.com/actions/download-artifact/releases/tag/v4.1.7
122- with :
123- name : webhook-artifacts-${{ matrix.arch }}
124- path : dist/artifacts
125-
126- - name : Move binary to bin/
127- run : |
128- mkdir -p bin/
129- cp -v dist/artifacts/webhook-linux-${{ matrix.arch }} bin/webhook
130- chmod +x bin/webhook
131-
132- # PANDARIA
133- # - name: "Read vault secrets"
134- # uses: rancher-eio/read-vault-secrets@main
135- # with:
136- # secrets: |
137- # secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
138- # secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_PASSWORD
139-
140111 - name : Set up QEMU
141112 # https://github.com/docker/setup-qemu-action/releases/tag/v3.1.0
142113 uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
@@ -145,30 +116,34 @@ jobs:
145116 uses : docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
146117 # https://github.com/docker/setup-buildx-action/releases/tag/v3.4.0
147118
148- - name : Log in to the Container registry
149- # https://github.com/docker/login-action/releases/tag/v3.2.0
150- uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
151- with :
152- registry : ${{ env.REGISTRY }}
153- username : ${{ secrets.TCR_USERNAME }}
154- password : ${{ secrets.TCR_TOKEN }}
155-
156119 - name : Build and push the webhook image
157- id : build
158- # https://github.com/docker/build-push-action/releases/tag/v6.3.0
159- uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
120+ uses : docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
160121 with :
161122 context : .
162123 file : ./package/Dockerfile
124+ secrets : |
125+ token=${{ secrets.RD_ONLY_GH_TOKEN }}
163126 platforms : " linux/${{ matrix.arch }}"
164127 outputs : type=image,name=${{ env.REGISTRY }}/${{ env.REPO }}/rancher-webhook,push-by-digest=true,name-canonical=true,push=true
128+ build-args : |
129+ VERSION=${{ env.VERSION }}
130+ COMMIT=${{ env.COMMIT }}
131+ GOPRIVATE=github.com/cnrancher
165132
166133 - name : Export digest
167134 run : |
168135 mkdir -p /tmp/digests
169136 digest="${{ steps.build.outputs.digest }}"
170137 touch "/tmp/digests/${digest#sha256:}"
171138
139+ - name : Log in to the Container registry
140+ uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
141+ # https://github.com/docker/login-action/releases/tag/v3.2.0
142+ with :
143+ registry : ${{ env.REGISTRY }}
144+ username : ${{ secrets.TCR_USERNAME }}
145+ password : ${{ secrets.TCR_TOKEN }}
146+
172147 - name : Upload digest
173148 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
174149 # https://github.com/actions/upload-artifact/releases/tag/v4.3.3
@@ -194,18 +169,9 @@ jobs:
194169
195170 - name : Set up Docker Buildx
196171 uses : docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
197- # https://github.com/docker/setup-buildx-action/releases/tag/v3.4.0
198-
199- # PANDARIA
200- # - name: "Read vault secrets"
201- # uses: rancher-eio/read-vault-secrets@main
202- # with:
203- # secrets: |
204- # secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
205- # secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_PASSWORD
206172
207173 - name : Log in to the Container registry
208- uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6 .0
174+ uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5 .0
209175 # https://github.com/docker/login-action/releases/tag/v3.2.0
210176 with :
211177 registry : ${{ env.REGISTRY }}
@@ -222,6 +188,7 @@ jobs:
222188 run : |
223189 docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ env.REPO }}/rancher-webhook:${{ env.TAG_NAME }} \
224190 $(printf '${{ env.REGISTRY }}/${{ env.REPO }}/rancher-webhook@sha256:%s ' *)
191+
225192 image-sign :
226193 permissions :
227194 contents : read
0 commit comments