Skip to content

Commit

Permalink
Add publish to wire-builds step
Browse files Browse the repository at this point in the history
  • Loading branch information
smatting committed Jan 23, 2024
1 parent b9048c5 commit 0809b92
Showing 1 changed file with 64 additions and 2 deletions.
66 changes: 64 additions & 2 deletions .github/workflows/test_build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 "[email protected]"
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

0 comments on commit 0809b92

Please sign in to comment.