Skip to content

Commit

Permalink
release: patch latest references in versioned docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidweisse committed Jun 11, 2024
1 parent 0ee69fb commit 29fc2fc
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -150,14 +151,29 @@ 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 updated contrast releases file (from release branch)
- name: Download artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e #v4.1.7
with:
name: contrast-releases.json
path: ./contrast-main/packages/contrast-releases.json
merge-multiple: true
- 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: Commit updated contrast-releases.json
working-directory: contrast-main
run: |
mv ../contrast-releases.json ./packages/contrast-releases.json
git add ./packages/contrast-releases.json
git commit -m "packages/contrast-releases: add ${{ needs.process-inputs.outputs.MAJOR_MINOR_PATCH }}"
- name: Bump flake version to post release patch pre-version
Expand Down Expand Up @@ -242,6 +258,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
Expand Down

0 comments on commit 29fc2fc

Please sign in to comment.