1010 description : ' Kubernetes version to test with'
1111 required : false
1212 default : ' v1.33.0'
13- type : choice
14- options :
15- - v1.33.0
16- - v1.32.0
17- - v1.31.0
18- dry_run :
19- description : ' Perform dry run (no actual publishing)'
20- required : false
21- default : false
22- type : boolean
2313 nightly_bucket :
2414 description : ' Nightly bucket for builds'
2515 required : false
2616 default : ' gs://tekton-releases-nightly/pipeline'
2717 type : string
28- # uncomment the following to enable manual testing of the workflow
29- # push:
30- # branches:
31- # - test-rel
32- # paths:
33- # - '.github/workflows/nightly-builds.yaml'
34- # - 'tekton/**'
35- # - 'cmd/**'
36- # - 'pkg/**'
3718
3819env :
3920 KUBERNETES_VERSION : ${{ inputs.kubernetes_version || 'v1.33.0' }}
4021 REGISTRY : ghcr.io
41- DRY_RUN : ${{ inputs.dry_run || false }}
42-
43- COMPONENT : pipeline
44-
4522 PACKAGE : github.com/${{ github.repository }}
46- GIT_ORG : ${{ github.repository_owner }}
47- GIT_REPO : ${{ github.event.repository.name }}
48- BUCKET : ${{ inputs.nightly_bucket || 'gs://anitha-tekton-nightly-test/pipeline' }}
23+ BUCKET : ${{ inputs.nightly_bucket || 'gs://tekton-releases-nightly/pipeline' }}
4924 IMAGE_REGISTRY_PATH : ${{ github.repository }}
50- IMAGE_REGISTRY_USER : ${{ github.actor }}
25+ IMAGE_REGISTRY_USER : tekton-robot
5126
5227jobs :
5328 build :
@@ -90,28 +65,33 @@ jobs:
9065 env :
9166 GITHUB_TOKEN : ${{ secrets.GHCR_TOKEN || github.token }}
9267 run : |
68+ # Create Git authentication secret with proper Tekton annotations
9369 kubectl create secret generic git-resolver-secret \
9470 --from-literal=token="${GITHUB_TOKEN}" \
9571 -n tekton-pipelines-resolvers || true
9672
97- kubectl patch configmap resolvers-feature-flags -n tekton-pipelines-resolvers --patch='
98- data:
99- enable-git-resolver: "true"
100- enable-hub-resolver: "true"
101- enable-bundles-resolver: "true"
102- enable-cluster-resolver: "true"
103- ' || true
73+ kubectl annotate secret git-resolver-secret \
74+ tekton.dev/git-0=github.com \
75+ -n tekton-pipelines-resolvers || true
10476
77+ kubectl create secret generic git-resolver-secret \
78+ --from-literal=token="${GITHUB_TOKEN}" \
79+ -n default || true
80+
81+ kubectl annotate secret git-resolver-secret \
82+ tekton.dev/git-0=github.com \
83+ -n default || true
84+
10585 kubectl patch configmap git-resolver-config -n tekton-pipelines-resolvers --patch='
10686 data:
107- default-url: "https://github.com"
108- default-revision: "main"
109- fetch-timeout: "1m"
110- scm-type: "github"
111- server-url: "https://api.github.com"
11287 api-token-secret-name: "git-resolver-secret"
11388 api-token-secret-key: "token"
11489 ' || true
90+
91+ kubectl patch configmap feature-flags -n tekton-pipelines --patch='
92+ data :
93+ enable-cel-in-whenexpression : " true"
94+ ' || true
11595
11696 - name: Install tkn CLI
11797 uses: tektoncd/actions/setup-tektoncd-cli@main
@@ -120,24 +100,30 @@ jobs:
120100
121101 - name: Apply Build Pipeline Definition
122102 run: |
123- kubectl apply -f tekton/publish.yaml
124- kubectl apply -f tekton/release-pipeline.yaml
103+ kustomize build tekton | kubectl apply -f -
125104
126- - name : Create secrets and PVC template
105+ - name: Create secrets, service account and PVC template
127106 env:
128107 GCS_SERVICE_ACCOUNT_KEY: ${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}
129108 GHCR_TOKEN: ${{ secrets.GHCR_TOKEN || github.token }}
109+ IMAGE_REGISTRY_USER: ${{ env.IMAGE_REGISTRY_USER }}
130110 run: |
111+ # Create GCS service account secret for release bucket access
131112 echo "${GCS_SERVICE_ACCOUNT_KEY}" > /tmp/gcs-key.json
132113 kubectl create secret generic release-secret \
133114 --from-file=release.json=/tmp/gcs-key.json
134115 rm -f /tmp/gcs-key.json
135-
136- kubectl create secret docker-registry ghcr-creds \
137- --docker-server=ghcr.io \
138- --docker-username=${{ github.actor }} \
139- --docker-password="${GHCR_TOKEN}" \
140- --docker-email=${{ github.actor }}@users.noreply.github.com
116+
117+ # Create a Kubernetes secret for GHCR authentication.
118+ # This version creates the secret with a custom key name `docker-config.json`
119+ # (instead of the default `.dockerconfigjson`) to match what the publish task expects.
120+ echo "${GHCR_TOKEN}" > /tmp/docker-config.json
121+ kubectl create secret generic release-images-secret \
122+ --from-file=docker-config.json=/tmp/docker-config.json
123+ rm -f /tmp/docker-config.json
124+
125+ # Apply service account configuration with proper RBAC
126+ kubectl apply -f tekton/account.yaml
141127
142128 cat > workspace-template.yaml << EOF
143129 spec:
@@ -155,6 +141,7 @@ jobs:
155141 echo "Starting Tekton pipeline..."
156142
157143 PIPELINE_RUN=$(tkn pipeline start pipeline-release \
144+ --serviceaccount=release-right-meow \
158145 --param package="${{ env.PACKAGE }}" \
159146 --param gitRevision="${{ steps.version.outputs.latest_sha }}" \
160147 --param versionTag="${{ steps.version.outputs.version_tag }}" \
@@ -163,17 +150,18 @@ jobs:
163150 --param imageRegistryPath="${{ env.IMAGE_REGISTRY_PATH }}" \
164151 --param imageRegistryUser="${{ env.IMAGE_REGISTRY_USER }}" \
165152 --param imageRegistryRegions="" \
166- --param buildPlatforms="linux/amd64" \
167- --param publishPlatforms="linux/amd64" \
153+ --param buildPlatforms="linux/amd64,linux/arm64,linux/s390x,linux/ppc64le " \
154+ --param publishPlatforms="linux/amd64,linux/arm64,linux/s390x,linux/ppc64le,windows/amd64 " \
168155 --param koExtraArgs="" \
169156 --param serviceAccountPath=release.json \
170- --param serviceAccountImagesPath=.dockerconfigjson \
171- --param releaseAsLatest="false " \
157+ --param serviceAccountImagesPath=docker-config.json \
158+ --param releaseAsLatest="true " \
172159 --param runTests="false" \
173160 --workspace name=workarea,volumeClaimTemplateFile=workspace-template.yaml \
174161 --workspace name=release-secret,secret=release-secret \
175- --workspace name=release-images-secret,secret=ghcr-creds \
176- --pipeline-timeout 2h \
162+ --workspace name=release-images-secret,secret=release-images-secret \
163+ --tasks-timeout 2h \
164+ --pipeline-timeout 3h \
177165 --output name) || {
178166 echo "Failed to start Tekton pipeline!"
179167 exit 1
0 commit comments