diff --git a/.github/workflows/test_build_deploy.yml b/.github/workflows/test_build_deploy.yml index f02bded8fd..682c4579e1 100644 --- a/.github/workflows/test_build_deploy.yml +++ b/.github/workflows/test_build_deploy.yml @@ -22,8 +22,7 @@ jobs: outputs: wire_builds_target_branches: ${{ steps.output_target_branches.outputs.wire_builds_target_branches }} - # chart_version: ${{ steps.publish_helm_chart.outputs.chart_version }} - + chart_version: ${{ steps.publish_helm_chart.outputs.chart_version }} steps: - name: Checkout @@ -209,3 +208,66 @@ jobs: body_path: ./CHANGELOG.md draft: false prerelease: false + + publish_wire_builds: + name: Bump account-pages chart in wire-builds + runs-on: ubuntu-latest + needs: test_build_deploy + + strategy: + matrix: + target_branch: ${{fromJSON(needs.test_build_deploy.outputs.wire_builds_target_branches)}} + + steps: + - name: Check out wire-builds + uses: actions/checkout@v4 + with: + repository: wireapp/wire-builds + token: ${{secrets.WIRE_BUILDS_WRITE_ACCESS_GH_TOKEN}} + ref: ${{matrix.target_branch}} + fetch-depth: 1 + + - name: Create new build in wire-build + shell: bash + run: | + set -eo pipefail + + chart_version="${{needs.test_build_deploy.outputs.chart_version}}" + + git config --global user.email "zebot@users.noreply.github.com" + git config --global user.name "Zebot" + + image_tag="${{needs.test_build_deploy.outputs.image_tag}}" + + for retry in $(seq 3); do + ( + set -e + + if (( retry > 1 )); then + echo "Retrying..." + fi + + git fetch --depth 1 origin "${{ matrix.target_branch }}" + git checkout "${{ matrix.target_branch }}" + git reset --hard @{upstream} + + build_json=$(cat ./build.json | \ + ./bin/set-chart-fields webapp \ + "version=$chart_version" \ + "repo=https://s3-eu-west-1.amazonaws.com/public.wire.com/charts-webapp" \ + "meta.appVersion=$image_tag" \ + "meta.commitURL=${{github.event.head_commit.url}}" \ + "meta.commit=${{github.event.head_commit.id}}" \ + | ./bin/bump-prerelease ) + echo "$build_json" > ./build.json + + git add build.json + git commit -m "Bump account-pages to $chart_version" + git push origin "${{ matrix.target_branch }}" + + ) && break + done + if (( $? != 0 )); then + echo "Retrying didn't help. Failing the step." + exit 1 + fi