Skip to content

Commit 3facd4e

Browse files
authored
fix(release): promote project version after attestation push (#2807)
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
1 parent 1b0f4c7 commit 3facd4e

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

.github/workflows/contracts/chainloop-vault-release.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ spec:
1111
with:
1212
requirement_name: sbom-compliance
1313
gate: true
14-
attestation_phases:
15-
- INIT
1614
- ref: source-commit
1715
with:
1816
check_signature: yes

.github/workflows/release.yaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5858
outputs:
5959
attestation_hash: ${{ steps.attest_goreleaser.outputs.attestation_hash }}
60+
current_version: ${{ steps.project_version.outputs.current_version }}
6061

6162
steps:
6263
- name: Install Cosign
@@ -171,17 +172,11 @@ jobs:
171172
gh release download ${{ github.ref_name }} -A tar.gz -O /tmp/source-code.tar.gz
172173
chainloop attestation add --name source-code --value /tmp/source-code.tar.gz --kind ARTIFACT --attestation-id ${{ env.ATTESTATION_ID }}
173174
174-
- name: Promote Chainloop Project Version
175-
env:
176-
CHAINLOOP_PROJECT_NAME: "chainloop"
177-
CHAINLOOP_TOKEN: ${{ secrets.CHAINLOOP_TOKEN }}
175+
- name: Read current project version
176+
id: project_version
178177
run: |
179-
current_version="$(cat .chainloop.yml | awk '/^projectVersion:/ {print $2}')"
180-
# Rename the existing pre-release into the actual release name
181-
echo "current_version=$current_version"
182-
echo "target_version=${{ github.ref_name }}"
183-
chainloop org describe
184-
chainloop project version update --project ${CHAINLOOP_PROJECT_NAME} --name $current_version --new-name ${{ github.ref_name }} || true
178+
current_version="$(awk '/^projectVersion:/ {print $2}' .chainloop.yml)"
179+
echo "current_version=$current_version" >> $GITHUB_OUTPUT
185180
186181
- name: Bump Chart and Dagger Version
187182
run: .github/workflows/utils/bump-chart-and-dagger-version.sh deployment/chainloop extras/dagger ${{ github.ref_name }}
@@ -230,6 +225,16 @@ jobs:
230225
exit 1
231226
fi
232227
228+
- name: Promote Chainloop Project Version
229+
if: ${{ success() }}
230+
env:
231+
CURRENT_VERSION: ${{ needs.release.outputs.current_version }}
232+
TARGET_VERSION: ${{ github.ref_name }}
233+
run: |
234+
echo "current_version=$CURRENT_VERSION"
235+
echo "target_version=$TARGET_VERSION"
236+
chainloop project version update --project chainloop --name "$CURRENT_VERSION" --new-name "$TARGET_VERSION" || true
237+
233238
- name: Mark attestation as failed
234239
if: ${{ failure() }}
235240
run: |

0 commit comments

Comments
 (0)