diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 890f470d94..09074ddadc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,6 +121,7 @@ jobs: env: RELEASE_BRANCH: ${{ needs.process-inputs.outputs.RELEASE_BRANCH }} WORKING_BRANCH: ${{ needs.process-inputs.outputs.WORKING_BRANCH }} + MAJOR_MINOR: ${{ needs.process-inputs.outputs.MAJOR_MINOR }} steps: - name: Checkout working branch uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 @@ -150,6 +151,26 @@ jobs: git commit -am "docs: release ${{ needs.process-inputs.outputs.MAJOR_MINOR }}" # Clean up auxiliary files, so next steps run on a clean tree git clean -fx :/ + - name: Download image replacements artifcat + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e #v4.1.7 + with: + name: image-replacements.txt + path: ./image-replacements.txt + - name: Patch latest references in docs + shell: bash + run: | + while IFS= read -r line; do + target=$(echo "$line" | cut -d"=" -f2) + source=$(echo "$line" | sed "s/:.*//" | sed "s/\./\\\./g") + find ./contrast-main/docs/versioned_docs/version-$MAJOR_MINOR -type f -exec sed -i "s#$source\(:[a-zA-Z0-9_.-]\{1,\}\|@sha256:[a-fA-F0-9]\{64\}\)#$target#g" {} \; + done <"./image-replacements.txt" + + find ./contrast-main/docs/versioned_docs/version-$MAJOR_MINOR -type f -exec sed -i "s#github.com/edgelesssys/contrast/releases/latest/download/#github.com/edgelesssys/contrast/releases/download/${{ inputs.version }}/#g" {} \; + - name: Commit updated docs + working-directory: contrast-main + run: | + git add docs/versioned_docs/version-$MAJOR_MINOR + git commit -m "docs: patch latest references" - name: Download updated contrast releases file (from release branch) uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e #v4.1.7 with: @@ -242,6 +263,11 @@ jobs: echo "ghcr.io/edgelesssys/contrast/initializer:latest=$initializerImgTagged" >> image-replacements.txt echo "ghcr.io/edgelesssys/contrast/service-mesh-proxy:latest=$serviceMeshImgTagged" >> image-replacements.txt echo "ghcr.io/edgelesssys/contrast/node-installer:latest=$nodeInstallerImgTagged" >> image-replacements.txt + - name: Upload image replacements file (for main branch PR) + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + with: + name: image-replacements.txt + path: ./image-replacements.txt - name: Create portable coordinator resource definitions run: | mkdir -p workspace deployment