1- name : Publish ArgoCD Release
1+ name : Create ArgoCD release
22on :
33 push :
44 tags :
5- - ' v*'
6- - ' !v2.4*'
7- - ' !v2.5*'
8- - ' !v2.6*'
9-
10- permissions : {}
5+ - " release-v**"
6+ - " !release-v1.5*"
7+ - " !release-v1.4*"
8+ - " !release-v1.3*"
9+ - " !release-v1.2*"
10+ - " !release-v1.1*"
11+ - " !release-v1.0*"
12+ - " !release-v0*"
1113
1214env :
1315 # renovate: datasource=golang-version packageName=golang
4042 packages : write # for uploading attestations. (https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#known-issues)
4143 # Must be refernced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
4244 if : github.repository == 'argoproj/argo-cd'
43- uses : slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0 .0
45+ uses : slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.9 .0
4446 with :
4547 image : quay.io/argoproj/argocd
4648 digest : ${{ needs.argocd-image.outputs.image-digest }}
5658 contents : write # used for uploading assets
5759 if : github.repository == 'argoproj/argo-cd'
5860 runs-on : ubuntu-22.04
61+ env :
62+ ARTIFACT_NAME : release-notes
5963 outputs :
60- hashes : ${{ steps.hash.outputs.hashes }}
64+ TARGET_VERSION : ${{ steps.setup-vars.outputs.TARGET_VERSION }}
65+ TARGET_BRANCH : ${{ steps.setup-vars.outputs.TARGET_BRANCH }}
66+ PRE_RELEASE : ${{ steps.setup-vars.outputs.PRE_RELEASE }}
67+ RELEASE_TAG : ${{ steps.setup-vars.outputs.RELEASE_TAG }}
68+ RELEASE_NOTES : ${{ steps.release-notes.outputs.RELEASE_NOTES }}
6169
6270 steps :
6371 - name : Checkout code
8593 echo "KUBECTL_VERSION=$(go list -m k8s.io/client-go | head -n 1 | rev | cut -d' ' -f1 | rev)" >> $GITHUB_ENV
8694 echo "GIT_TREE_STATE=$(if [ -z "`git status --porcelain`" ]; then echo "clean" ; else echo "dirty"; fi)" >> $GITHUB_ENV
8795
88- - name : Free Disk Space (Ubuntu)
89- uses : jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
90- with :
91- large-packages : false
92- docker-images : false
93- swap-storage : false
94- tool-cache : false
95-
9696 - name : Run GoReleaser
9797 uses : goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
9898 id : run-goreleaser
@@ -126,7 +126,7 @@ jobs:
126126 contents : write # Needed for release uploads
127127 if : github.repository == 'argoproj/argo-cd'
128128 # Must be refernced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
129- uses : slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0 .0
129+ uses : slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.9 .0
130130 with :
131131 base64-subjects : " ${{ needs.goreleaser.outputs.hashes }}"
132132 provenance-name : " argocd-cli.intoto.jsonl"
@@ -135,21 +135,43 @@ jobs:
135135 generate-sbom :
136136 name : Create SBOM and generate hash
137137 needs :
138- - argocd-image
139- - goreleaser
140- permissions :
141- contents : write # Needed for release uploads
142- outputs :
143- hashes : ${{ steps.sbom-hash.outputs.hashes}}
144- if : github.repository == 'argoproj/argo-cd'
145- runs-on : ubuntu-22.04
138+ - prepare-release
139+ - binaries
140+ - container-image
146141 steps :
147142 - name : Checkout code
148143 uses : actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
149144 with :
150145 fetch-depth : 0
151146 token : ${{ secrets.GITHUB_TOKEN }}
152147
148+ - name : Setup Git author information
149+ run : |
150+ set -ue
151+ git config --global user.email "${GIT_EMAIL}"
152+ git config --global user.name "${GIT_USERNAME}"
153+ - name : Checkout corresponding release branch
154+ run : |
155+ set -ue
156+ echo "Switching to release branch '${TARGET_BRANCH}'"
157+ if ! git checkout ${TARGET_BRANCH}; then
158+ echo "::error::Checking out release branch '${TARGET_BRANCH}' for target version '${TARGET_VERSION}' (tagged '${RELEASE_TAG}') failed. Does it exist in repo?"
159+ exit 1
160+ fi
161+
162+ - name : Create the release tag
163+ run : |
164+ set -ue
165+ echo "Creating release ${RELEASE_TAG}"
166+ git tag ${RELEASE_TAG}
167+
168+ - name : Push changes to release branch
169+ run : |
170+ set -ue
171+ # Codefresh change
172+ # git push origin ${TARGET_BRANCH}
173+ git push origin ${RELEASE_TAG}
174+
153175 - name : Setup Golang
154176 uses : actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
155177 with :
@@ -166,7 +188,7 @@ jobs:
166188 # managers (gomod, yarn, npm).
167189 PROJECT_FOLDERS : " .,./ui"
168190 # full qualified name of the docker image to be inspected
169- DOCKER_IMAGE : quay.io/argoproj/ argocd:${{ github.ref_name }}
191+ DOCKER_IMAGE : ${{env.IMAGE_NAMESPACE}}/ argocd:v ${{env.TARGET_VERSION }}
170192 run : |
171193 yarn install --cwd ./ui
172194 go install github.com/spdx/spdx-sbom-generator/cmd/generator@$SPDX_GEN_VERSION
@@ -199,7 +221,10 @@ jobs:
199221 env :
200222 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
201223 with :
224+ token : ${{ secrets.GITHUB_TOKEN }}
225+ name : ${{ env.RELEASE_TAG }}
202226 files : |
227+ argocd-*
203228 /tmp/sbom.tar.gz
204229
205230 sbom-provenance :
@@ -228,12 +253,13 @@ jobs:
228253 runs-on : ubuntu-22.04
229254 steps :
230255 - name : Checkout code
231- uses : actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
256+ uses : actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
232257 with :
233- fetch-depth : 0
234- token : ${{ secrets.GITHUB_TOKEN }}
258+ token : ${{env.HOMEBREW_TOKEN}}
259+ formula : argocd
260+ if : ${{ env.HOMEBREW_TOKEN != '' && env.UPDATE_HOMEBREW == 'true' && env.PRE_RELEASE != 'true' }}
235261
236- - name : Setup Git author information
262+ - name : Delete original request tag from repository
237263 run : |
238264 set -ue
239265 git config --global user.email 'ci@argoproj.com'
@@ -289,7 +315,7 @@ jobs:
289315 # Replace the 'project-release: vX.X.X-rcX' line in SECURITY-INSIGHTS.yml
290316 sed -i "s/project-release: v.*$/project-release: v${{ env.NEW_VERSION }}/" SECURITY-INSIGHTS.yml
291317 # Update the 'commit-hash: XXXXXXX' line in SECURITY-INSIGHTS.yml
292- sed -i "s/commit-hash: .*/commit-hash: ${{ env.COMMIT_HASH }}/" SECURITY-INSIGHTS.yml
318+ sed -i "s/commit-hash: .*/commit-hash: ${{ env.NEW_VERSION }}/" SECURITY-INSIGHTS.yml
293319 if : ${{ env.UPDATE_VERSION == 'true' }}
294320
295321 - name : Create PR to update VERSION on master branch
0 commit comments