Skip to content

Commit a51766a

Browse files
committed
Update runner version in instance-management-deployments
1 parent dfc6f99 commit a51766a

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

bitrise.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,65 @@ workflows:
9999
100100
rm -f /tmp/gcs-key.json
101101
102+
- script@1:
103+
title: Update runner version in instance-management-deployments
104+
inputs:
105+
- content: |
106+
#!/usr/bin/env bash
107+
set -euo pipefail
108+
109+
VERSION="${RELEASE_TAG}"
110+
VERSION_NUM="${VERSION#v}"
111+
112+
echo "--- Computing SHA256 hashes for version ${VERSION}"
113+
114+
OSX_ARM64_HASH=$(sha256sum "${RELEASE_ASSETS_DIR}/actions-runner-osx-arm64-${VERSION_NUM}.tar.gz" | awk '{print $1}')
115+
LINUX_X64_HASH=$(sha256sum "${RELEASE_ASSETS_DIR}/actions-runner-linux-x64-${VERSION_NUM}.tar.gz" | awk '{print $1}')
116+
117+
echo "osx-arm64: ${OSX_ARM64_HASH}"
118+
echo "linux-x64: ${LINUX_X64_HASH}"
119+
120+
echo "--- Cloning instance-management-deployments"
121+
122+
REPO_DIR=$(mktemp -d)
123+
git clone --branch staging "https://x-access-token:${GITHUB_TOKEN}@github.com/bitrise-io/instance-management-deployments.git" "${REPO_DIR}"
124+
125+
VERSIONS_FILE="${REPO_DIR}/instance-manager-pool-controller/files/github_runner_versions.yaml"
126+
127+
echo "--- Adding version ${VERSION} to ${VERSIONS_FILE}"
128+
129+
yq -i ".versions.\"${VERSION}\".\"osx-arm64\" = \"${OSX_ARM64_HASH}\"" "${VERSIONS_FILE}"
130+
yq -i ".versions.\"${VERSION}\".\"linux-x64\" = \"${LINUX_X64_HASH}\"" "${VERSIONS_FILE}"
131+
132+
echo "--- Updated file content:"
133+
cat "${VERSIONS_FILE}"
134+
135+
cd "${REPO_DIR}"
136+
git config user.name "bitrise-infrabot"
137+
git config user.email "bitrise-infrabot@bitrise.io"
138+
git checkout -b "runner-${VERSION}"
139+
git add instance-manager-pool-controller/files/github_runner_versions.yaml
140+
git commit -m "Add GitHub runner ${VERSION}"
141+
git push origin "runner-${VERSION}"
142+
143+
echo "--- Creating pull request"
144+
145+
PR_URL=$(curl -sf \
146+
-X POST \
147+
-H "Accept: application/vnd.github+json" \
148+
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
149+
"https://api.github.com/repos/bitrise-io/instance-management-deployments/pulls" \
150+
-d "{
151+
\"title\": \"Add GitHub runner ${VERSION}\",
152+
\"head\": \"runner-${VERSION}\",
153+
\"base\": \"staging\",
154+
\"body\": \"Adds runner version ${VERSION} with asset hashes from the release.\"
155+
}" | jq -r '.html_url')
156+
157+
echo "Pull request created: ${PR_URL}"
158+
159+
rm -rf "${REPO_DIR}"
160+
102161
meta:
103162
bitrise.io:
104163
stack: ubuntu-noble-24.04-bitrise-2025-base

0 commit comments

Comments
 (0)