Skip to content

Instantly share code, notes, and snippets.

@lbussell
Created December 13, 2022 18:51
Show Gist options
  • Save lbussell/2e3f445668e8c1f1f8eb83a8fd1ff4ad to your computer and use it in GitHub Desktop.
Save lbussell/2e3f445668e8c1f1f8eb83a8fd1ff4ad to your computer and use it in GitHub Desktop.
Mirror and tag .NET source build releases
#!/bin/bash
set -euxo pipefail
RELEASE_CHANNEL="7.0"
RUNTIME_VERSION="7.0.X"
SDK_VERSION="7.0.1XX"
vmr_path="vmr"
dnceng_url="valid git url"
destination_url="valid git url"
branch_version=$(echo ${SDK_VERSION} | sed 's/..$/xx/')
branch_to_mirror="release/${branch_version}" # e.g. release/6.0.1xx
rm -rf "${vmr_path}"
git init "${vmr_path}"
tag-head () {
local message="Source-build ${RUNTIME_VERSION} runtime and ${SDK_VERSION} SDK"
git tag -s "$1" HEAD -m "${message}"
}
pushd "${vmr_path}"
git remote add dnceng "${dnceng_url}"
git fetch dnceng "${branch_to_mirror}"
git checkout "${branch_to_mirror}"
git remote add external "${destination_url}"
git fetch external "${branch_to_mirror}"
tag_name="v${SDK_VERSION}-SDK"
tag-head "${tag_name}"
git push external "${branch_to_mirror}"
git push external "${tag_name}"
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment