|
57 | 57 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
58 | 58 | outputs: |
59 | 59 | attestation_hash: ${{ steps.attest_goreleaser.outputs.attestation_hash }} |
| 60 | + current_version: ${{ steps.project_version.outputs.current_version }} |
60 | 61 |
|
61 | 62 | steps: |
62 | 63 | - name: Install Cosign |
@@ -171,17 +172,11 @@ jobs: |
171 | 172 | gh release download ${{ github.ref_name }} -A tar.gz -O /tmp/source-code.tar.gz |
172 | 173 | chainloop attestation add --name source-code --value /tmp/source-code.tar.gz --kind ARTIFACT --attestation-id ${{ env.ATTESTATION_ID }} |
173 | 174 |
|
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 |
178 | 177 | 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 |
185 | 180 |
|
186 | 181 | - name: Bump Chart and Dagger Version |
187 | 182 | run: .github/workflows/utils/bump-chart-and-dagger-version.sh deployment/chainloop extras/dagger ${{ github.ref_name }} |
@@ -230,6 +225,16 @@ jobs: |
230 | 225 | exit 1 |
231 | 226 | fi |
232 | 227 |
|
| 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 | +
|
233 | 238 | - name: Mark attestation as failed |
234 | 239 | if: ${{ failure() }} |
235 | 240 | run: | |
|
0 commit comments