From 4abdca77ada3bb4059b426d1e8588b2221ceea21 Mon Sep 17 00:00:00 2001 From: "Oleksandr.Didyk" Date: Tue, 20 Feb 2024 16:39:50 +0100 Subject: [PATCH] remove source for release pipeline --- eng/combine-tarballs.sh | 53 --- eng/create-announcement-draft.sh | 123 ----- eng/get-build-info.sh | 85 ---- eng/push-tarball.sh | 152 ------- eng/source-build-release-announcement.md | 19 - eng/source-build-release-notes.md | 4 - eng/source-build-release-official.yml | 171 ------- eng/source-build-release-pr.md | 5 - eng/submit-announcement.sh | 243 ---------- eng/submit-source-build-release-pr.sh | 213 --------- eng/templates/stages/mirror.yml | 265 ----------- eng/templates/stages/pre-release.yml | 135 ------ eng/templates/stages/release.yml | 423 ------------------ .../steps/download-smoke-test-prereqs.yml | 21 - .../steps/initialize-release-info.yml | 179 -------- .../steps/upload-to-blob-storage.yml | 51 --- .../variables/msrc-storage-variables.yml | 16 - eng/templates/variables/pipelines.yml | 14 - 18 files changed, 2172 deletions(-) delete mode 100755 eng/combine-tarballs.sh delete mode 100755 eng/create-announcement-draft.sh delete mode 100644 eng/get-build-info.sh delete mode 100755 eng/push-tarball.sh delete mode 100644 eng/source-build-release-announcement.md delete mode 100644 eng/source-build-release-notes.md delete mode 100644 eng/source-build-release-official.yml delete mode 100644 eng/source-build-release-pr.md delete mode 100755 eng/submit-announcement.sh delete mode 100755 eng/submit-source-build-release-pr.sh delete mode 100644 eng/templates/stages/mirror.yml delete mode 100644 eng/templates/stages/pre-release.yml delete mode 100644 eng/templates/stages/release.yml delete mode 100644 eng/templates/steps/download-smoke-test-prereqs.yml delete mode 100644 eng/templates/steps/initialize-release-info.yml delete mode 100644 eng/templates/steps/upload-to-blob-storage.yml delete mode 100644 eng/templates/variables/msrc-storage-variables.yml delete mode 100644 eng/templates/variables/pipelines.yml diff --git a/eng/combine-tarballs.sh b/eng/combine-tarballs.sh deleted file mode 100755 index ebb4680d7e..0000000000 --- a/eng/combine-tarballs.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -### Usage: combine-tarballs.sh [OPTIONS] [file1] [file2] ... [fileN] -### -### Combines the contents of multiple tarballs into a single tarball. -### -### Options: -### --output The destination path of the output tarball -### --help, -h (Optional) Print this help message and exit - -set -euo pipefail -source="${BASH_SOURCE[0]}" - -function print_help () { - sed -n '/^### /,/^$/p' "$source" | cut -b 5- -} - -outputPath='' - -if [[ $# -gt 0 ]]; then - opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -h | --help ) - print_help - exit 0 - ;; - --output ) - outputPath="$2" - shift 2 - ;; - *) - ;; - esac -else - print_help - exit 0 -fi - -: "${outputPath:?Missing --output}" - -tmpDir=$(mktemp -d) - -# The rest of the args are the paths to the input tarball -for arg in "$@" -do - echo "Extracting '${arg}' to '${tmpDir}'" - tar -xf "${arg}" -C $tmpDir -done - -echo "Generating tarball '${outputPath}' from '${tmpDir}'" -tar --numeric-owner -cf "${outputPath}" -C $tmpDir . - -rm -rf $tmpDir diff --git a/eng/create-announcement-draft.sh b/eng/create-announcement-draft.sh deleted file mode 100755 index 7fec6fc5b6..0000000000 --- a/eng/create-announcement-draft.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash - -### Usage: $0 [options] -### -### Fills out a template of a release announcement and prints it out. -### -### Options: -### --template The base template to use for the announcement -### --channel Release channel, e.g. 8.0 -### Note that when 6.0/7.0, dotnet/installer is targeted, otherwise dotnet/dotnet -### --release Programmatic name of the release, e.g. 8.0.0.preview-1 -### --release-name Human readable name of the release, e.g. .NET 8 Preview 1 -### --sdk-version The .NET SDK version that is being released -### --runtime-version The .NET runtime version that is being released -### --tag The release tag, e.g. v8.0.0-preview.1 -### --source-version SHA (Optional) The dotnet/dotnet SHA of the commit that is being released -### --prerelease (Optional) Whether this is a preview release -### --help, -h (Optional) Print this help message and exit - -set -euo pipefail -source="${BASH_SOURCE[0]}" - -function print_help () { - sed -n '/^### /,/^$/p' "$source" | cut -b 5- -} - -template='' -channel='' -release='' -release_name='' -sdk_version='' -source_version='' -runtime_version='' -tag='' -prerelease=false - -while [[ $# -gt 0 ]]; do - opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -h | --help ) - print_help - exit 0 - ;; - --template ) - template="$2" - shift 2 - ;; - --channel ) - channel="$2" - shift 2 - ;; - --release ) - release="$2" - shift 2 - ;; - --release-name ) - release_name="$2" - shift 2 - ;; - --sdk-version ) - sdk_version="$2" - shift 2 - ;; - --runtime-version ) - runtime_version="$2" - shift 2 - ;; - --tag ) - tag="$2" - shift 2 - ;; - --source-version ) - source_version="$2" - shift 2 - ;; - --prerelease ) - prerelease=true - shift 1 - ;; - *) - echo "Invalid argument $1" - exit 1 - ;; - esac -done - -: "${template:?Missing --template}" -: "${channel:?Missing --channel}" -: "${release:?Missing --release}" -: "${release_name:?Missing --release-name}" -: "${sdk_version:?Missing --sdk-version}" -: "${runtime_version:?Missing --runtime-version}" -: "${tag:?Missing --tag}" - -# Set environment variables that go in the announcement template -export TAG="$tag" -export RELEASE="$release" -export RELEASE_NAME="$release_name" -export RUNTIME_VERSION="$runtime_version" -export RELEASE_CHANNEL="$channel" -export SDK_VERSION="$sdk_version" -export RELEASE_DATE=$(date +"%B %Y") # e.g. "March 2022" -export SOURCE_VERSION="$source_version" - -if [[ "$channel" == '6.0' || "$channel" == '7.0' ]]; then - export TAG_URL="https://github.com/dotnet/installer/releases/tag/$tag" -else - export TAG_URL="https://github.com/dotnet/dotnet/releases/tag/$tag" -fi - -if [[ "$prerelease" == true ]]; then - export RELEASE_NOTES_URL="https://github.com/dotnet/core/blob/main/release-notes/$RELEASE_CHANNEL/preview/$RELEASE.md" - - # Removes the build number so that 8.0.100-preview.3.23178.7 becomes 8.0.100-preview.3 - export SDK_VERSION_SHORT=$(echo "$SDK_VERSION" | sed 's/\(.*preview\.[0-9]\+\).*/\1/') - export RUNTIME_VERSION_SHORT=$(echo "$RUNTIME_VERSION" | sed 's/\(.*preview\.[0-9]\+\).*/\1/') -else - export RELEASE_NOTES_URL="https://github.com/dotnet/core/blob/main/release-notes/$RELEASE_CHANNEL/$RUNTIME_VERSION/$SDK_VERSION.md" - export SDK_VERSION_SHORT="$SDK_VERSION" - export RUNTIME_VERSION_SHORT="$RUNTIME_VERSION" -fi - -envsubst < "$template" diff --git a/eng/get-build-info.sh b/eng/get-build-info.sh deleted file mode 100644 index dbe1e315ed..0000000000 --- a/eng/get-build-info.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash - -az config set extension.use_dynamic_install=yes_without_prompt - -function get_build_run () { - local pipeline_id="$1" - local pipeline_name="$2" - local azdo_org="$3" - local azdo_project="$4" - local check_build_status="$5" - local search_by="$6" - local query="$7" - - # We search by a tag or by a commit for which the build was running - # We use the tag for the VMR builds (8.0+) and the commit for older installer builds - if [[ "$search_by" == 'tag' ]]; then - build_runs=$(az pipelines runs list --organization "$azdo_org" --project "$azdo_project" --pipeline-ids "$pipeline_id" --tags "$query") - elif [[ "$search_by" == 'name' ]]; then - build_runs=$(az pipelines runs list --organization "$azdo_org" --project "$azdo_project" --pipeline-ids "$pipeline_id" --query "[?buildNumber == '$query']") - else - build_runs=$(az pipelines runs list --organization "$azdo_org" --project "$azdo_project" --pipeline-ids "$pipeline_id" --query "[?sourceVersion == '$query']") - fi - - runs=$(echo "$build_runs" | jq -r '[.[] | { "result": .result, "id": .id, "buildNumber": .buildNumber, "sourceVersion": .sourceVersion }]') - run_count=$(echo "$runs" | jq 'length') - - if [ "$run_count" != "1" ]; then - set -x - echo "##vso[task.logissue type=error]There are $run_count runs of $pipeline_name with $search_by='$query'. Please manually specify run ID to use." - echo "##vso[task.logissue type=error]Run IDs are: $runs" - set +x - exit 1 - fi - - run_id=$(echo "$runs" | jq -r '.[0].id') - run_source_version=$(echo "$runs" | jq -r '.[0].sourceVersion') - - if [[ "$check_build_status" == "True" ]]; then - run_result=$(echo "$runs" | jq -r '.[0].result') - if [[ "$run_result" == "failed" ]]; then - set -x - echo "##vso[task.logissue type=error]: ${pipeline_name} run ID ${run_id} failed. Please manually specify a build ID to use instead. Exiting..." - set +x - exit 1 - fi - fi - - echo "${run_id} ${run_source_version}" -} - -function print_build_info() { - local pipeline_name="$1" - local pipeline_variable_name="$2" - local source_version_variable_name="$3" - local run_id="$4" - local source_version="$5" - - echo "${pipeline_name} run ID: ${run_id}" - echo " Link: https://dev.azure.com/dnceng/internal/_build/results?buildId=${run_id}" - echo " Run revision: ${source_version}" - echo "##vso[task.setvariable variable=${pipeline_variable_name};isOutput=true]${run_id}" - echo "##vso[task.setvariable variable=${source_version_variable_name};isOutput=true]${source_version}" -} - -function get_build_info() { - local azdo_org="$1" - local azdo_project="$2" - local pipeline_id="$3" - local pipeline_name="$4" - local pipeline_variable_name="$5" - local source_version_variable_name="$6" - local check_build_status="$7" - local search_by="$8" - local query="$9" - - IFS=' ' - run_info=$(get_build_run "$pipeline_id" "$pipeline_name" "$azdo_org" "$azdo_project" "$check_build_status" "$search_by" "$query") - if [[ $? != "0" ]]; then - echo "$run_info" - exit 1 - fi - - read -r run_id source_version<<<"$run_info" - print_build_info "$pipeline_name" "$pipeline_variable_name" "$source_version_variable_name" "$run_id" "$source_version" -} diff --git a/eng/push-tarball.sh b/eng/push-tarball.sh deleted file mode 100755 index bfd8614fcc..0000000000 --- a/eng/push-tarball.sh +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/bash -set -euo pipefail - -print-help () -{ - echo "Pushes sources from a given tarball into a given repository" - echo - echo "Syntax: ./update-vmr.sh --releaseChannel 7.0 --sdkVersion 7.0.100 --upstream --tarball dotnet-sdk-source.tar.gz" - echo - echo "options:" - echo "--releaseChannel, -r The .NET SDK release channel (e.g. 6.0)" - echo "--sdkVersion, -v The .NET SDK version (e.g. 6.0.110)" - echo "--upstream, -u A valid git URL to the upstream repo to update from and push to" - echo "--tarball, -t The tarball to update the VMR with" - echo "--isDryRun, -d (Optional) If set, then don't push results to upstream" - echo "--help, -h (Optional) print this help message and exit" - echo -} - -SHORT=r:v:u:t:d:h -LONG=releaseChannel:,sdkVersion:,upstream:,tarball:,isDryRun,help - -OPTS=$(getopt --options $SHORT --long $LONG --name "$0" -- "$@") -if [ $? != 0 ] ; then echo "Failed to parse options." >&2 ; exit 1 ; fi -eval set -- "$OPTS" - -is_dry_run='false' - -while true ; do - case "$1" in - -h | --help ) - print-help - exit 0 - ;; - -r | --releaseChannel ) - release_channel="$2" - shift 2 - ;; - -v | --sdkVersion ) - sdk_version="$2" - shift 2 - ;; - -u | --upstream ) - upstream_url="$2" - shift 2 - ;; - -t | --tarball ) - source_tarball="$2" - shift 2 - ;; - -d | --isDryRun ) - is_dry_run=true - shift - ;; - -- ) - shift - break - ;; - *) - echo "Internal error! Are you missing required arguments?" - exit 1 - ;; - esac -done - -: ${release_channel:?Missing --releaseChannel} -: ${sdk_version:?Missing --sdkVersion} -: ${upstream_url:?Missing --upstream} -: ${source_tarball:?Missing --tarball} - -if [ ! -f "$source_tarball" ]; then - echo "##vso[task.logissue type=error]File $source_tarball not found on disk. Exiting..." -fi - -month_year=$(date +"%b%Y" -d "+14 days" | sed 's/.*/\L&/') # e.g. aug2022 - -vmr_path="$(pwd)/dotnet-vmr" - -# replace the last two characters in sdk_version with xx -branch_version=$(echo "$sdk_version" | sed 's/..$/xx/') -target_branch="release/$branch_version" # e.g. release/6.0.1xx - -rm -rf "$vmr_path" -git init "$vmr_path" - -pushd "$vmr_path" - git remote add upstream "$upstream_url" - git fetch upstream "$target_branch" --depth=1 - git checkout "$target_branch" - - new_branch_name="dev/$sdk_version-$month_year" - if git fetch upstream "$new_branch_name"; then - echo "Branch $new_branch_name already exists (possibly from a previous run)" - git checkout "$new_branch_name" - else - echo "Branch $new_branch_name not found in the remote" - git checkout -b "$new_branch_name" - fi - - # delete all contents except the .git folder - # otherwise we won't catch deleted files in a commit - ls | grep -v ".git" | xargs rm -rf - tar -xzf "$source_tarball" -C "$vmr_path" - - git config user.email "dotnet-maestro[bot]@users.noreply.github.com" - git config user.name "dotnet-maestro[bot]" - - git add -f . - git diff --staged --quiet || git commit -m "Update to .NET $sdk_version" - - # If the new and target branches are identical, the code has already been merged by a previous run and PR; - # hence, there is no need for a new PR. - if git diff "$new_branch_name" "$target_branch" --quiet; then - echo "##vso[task.logissue type=warning]No PR created because there are no new changes against $target_branch" - exit 0 - fi - - pr_url=$(echo $upstream_url | sed "s,_git.*,_apis/git/repositories/security-partners-dotnet/pullrequests?api-version=7.0,g") - data="{ - \"sourceRefName\": \"refs/heads/$new_branch_name\", - \"targetRefName\": \"refs/heads/$target_branch\", - \"title\": \"Update to $sdk_version\", - \"description\": \"Update to $sdk_version\" - }" - - if [ "$is_dry_run" = true ]; then - echo "Doing a dry run, not pushing to upstream. List of changes:" - git log --name-status HEAD^..HEAD || echo "No changes to commit." - echo "Would push $new_branch_name to $upstream_url" - echo "Would create PR from $new_branch_name to $target_branch" - echo "PR creation payload: $data" - echo "PR creation URL: $pr_url" - else - echo "Pushing branch to upstream." - git push -u upstream "$new_branch_name" - - echo "Creating PR from $new_branch_name to $target_branch" - pr_creation_response=$(curl -s -H 'Content-Type: application/json' -d "$data" "$pr_url") - repository_web_url=$(jq -r '.repository.webUrl | values' <<< "$pr_creation_response") - pr_id=$(jq -r '.pullRequestId | values' <<< "$pr_creation_response") - - if [ -n "$repository_web_url" ] && [ -n "$pr_id" ]; then - echo "$repository_web_url/pullrequest/$pr_id" - # The TF401179 error code indicates that there is already an open pull request for the source and target branches. - elif [[ "$pr_creation_response" =~ "TF401179" ]]; then - echo "##vso[task.logissue type=warning]An active pull request for the source and target branch already exists." - else - echo "##vso[task.logissue type=error]An unexpected error has occurred while creating the security partners PR!" - jq <<< "$pr_creation_response" - fi - fi -popd diff --git a/eng/source-build-release-announcement.md b/eng/source-build-release-announcement.md deleted file mode 100644 index f3fe666da7..0000000000 --- a/eng/source-build-release-announcement.md +++ /dev/null @@ -1,19 +0,0 @@ - - -Title: $RELEASE_NAME $RELEASE_DATE Update - .NET $RUNTIME_VERSION_SHORT and SDK $SDK_VERSION_SHORT - -Please use the [$TAG tag]($TAG_URL) to source-build .NET version $RUNTIME_VERSION / $SDK_VERSION. - -- Release Notes: $RELEASE_NOTES_URL -- Tag URL: $TAG_URL - -@dotnet/distro-maintainers - -```json -{ - "Channel": "$RELEASE_CHANNEL", - "Runtime": "$RUNTIME_VERSION", - "Sdk": "$SDK_VERSION", - "TagUrl": "$TAG_URL" -} -``` diff --git a/eng/source-build-release-notes.md b/eng/source-build-release-notes.md deleted file mode 100644 index b30cdcd54f..0000000000 --- a/eng/source-build-release-notes.md +++ /dev/null @@ -1,4 +0,0 @@ -You can build $RELEASE_NAME from the repository by cloning the release tag `$TAG` and following the build instructions in the [main README.md](https://github.com/dotnet/dotnet/blob/$TAG/README.md#building). - -Alternatively, you can build from the sources attached to this release directly. -More information on this process can be found in the [dotnet/dotnet repository](https://github.com/dotnet/dotnet/blob/$TAG/README.md#building-from-released-sources). diff --git a/eng/source-build-release-official.yml b/eng/source-build-release-official.yml deleted file mode 100644 index c04457412b..0000000000 --- a/eng/source-build-release-official.yml +++ /dev/null @@ -1,171 +0,0 @@ -name: $(Date:yyyyMMdd)$(Rev:.r) -appendCommitMessageToRunName: false - -trigger: none -pr: none - -resources: - pipelines: - - pipeline: dotnet-staging-pipeline-resource - source: Stage-DotNet - repositories: - - repository: dotnet-dotnet - type: git - name: dotnet-dotnet - ref: main - -pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals 1es-ubuntu-2004 - -parameters: -- name: dotnetMajorVersion - displayName: Major .NET version being released - type: string - values: [ '6.0', '7.0', '8.0' ] -- name: releaseName - displayName: Release name (e.g. ".NET 8.0 Preview 1") - type: string -- name: releaseBranchName - displayName: Release branch name (e.g. release/8.0.1xx-preview1) - type: string -- name: isPreviewRelease - displayName: Preview release - type: boolean - default: false -- name: useCustomTag - displayName: Use custom tag - type: boolean - default: false -- name: customTag - displayName: Custom release tag (e.g. v6.0.XYY-source-build) - type: string - default: ' ' -- name: useSpecificPipelineRunIDs - displayName: Use specific pipeline run IDs - type: boolean - default: false -- name: dotnetDotnetRunID - displayName: '[⚠️ 8.0] Specific dotnet-dotnet run name' - type: string - default: '202XXXXX.Y' -- name: dotnetInstallerOfficialRunID - displayName: '[⚠️ 6.0 / 7.0] Specific dotnet-installer-official-ci run name' - type: string - default: '202XXXXX.Y' -- name: dotnetInstallerTarballBuildRunID - displayName: '[⚠️ 6.0 / 7.0] Specific dotnet-installer-source-build-tarball-build run name' - type: string - default: '202XXXXX.Y' -- name: verifyBuildSuccess - displayName: Verify that associated pipeline runs succeeded - type: boolean - default: true -- name: skipPackageMirroring - displayName: Skip package mirroring - type: boolean - default: false -- name: createReleaseAnnouncement - displayName: Create release announcement - type: boolean - default: true -- name: announcementGist - displayName: Release announcement gist URL - type: string - default: ' ' -- name: submitReleasePR - displayName: Submit release PR - type: boolean - default: true -# Auto means that for dry run, we only create a draft release; full otherwise. -- name: createGitHubRelease - displayName: '[⚠️ 8.0] Create tag & release in dotnet/dotnet' - type: string - values: [ 'auto', 'skip', 'draft', 'full' ] - default: auto -- name: isDryRun - displayName: Dry run - type: boolean - default: false - -stages: -- template: templates/stages/pre-release.yml - parameters: - dotnetStagingPipelineResource: dotnet-staging-pipeline-resource - dotnetMajorVersion: ${{ parameters.dotnetMajorVersion }} - isPreviewRelease: ${{ parameters.isPreviewRelease }} - releaseBranchName: ${{ parameters.releaseBranchName }} - releaseName: ${{ parameters.releaseName }} - useSpecificPipelineRunIDs: ${{ parameters.useSpecificPipelineRunIDs }} - dotnetDotnetRunID: ${{ parameters.dotnetDotnetRunID }} - dotnetInstallerOfficialRunID: ${{ parameters.dotnetInstallerOfficialRunID }} - dotnetInstallerTarballBuildRunID: ${{ parameters.dotnetInstallerTarballBuildRunID }} - verifyBuildSuccess: ${{ parameters.verifyBuildSuccess }} - useCustomTag: ${{ parameters.useCustomTag }} - customTag: ${{ replace(parameters.customTag, ' ', '') }} - isDryRun: ${{ parameters.isDryRun }} - -- stage: MirrorApproval - ${{ if or(eq(parameters.dotnetMajorVersion, '6.0'), eq(parameters.dotnetMajorVersion, '7.0')) }}: - displayName: Approval - PR merged & ready for dotnet-security-partners mirroring. - ${{ else }}: - displayName: Approval - Ready for dotnet-security-partners mirroring. - dependsOn: PreRelease - jobs: - - deployment: MirrorApproval - pool: server - ${{ if or(eq(parameters.dotnetMajorVersion, '6.0'), eq(parameters.dotnetMajorVersion, '7.0')) }}: - displayName: Confirm PR merged & ready for dotnet-security-partners mirroring - ${{ else }}: - displayName: Confirm ready for dotnet-security-partners mirroring - ${{ if parameters.isDryRun }}: - environment: pr - ${{ if not(parameters.isDryRun) }}: - environment: Source Build Release - Mirror - -- template: templates/stages/mirror.yml - parameters: - dotnetStagingPipelineResource: dotnet-staging-pipeline-resource - dotnetMajorVersion: ${{ parameters.dotnetMajorVersion }} - isPreviewRelease: ${{ parameters.isPreviewRelease }} - releaseBranchName: ${{ parameters.releaseBranchName }} - useCustomTag: ${{ parameters.useCustomTag }} - skipPackageMirroring: ${{ parameters.skipPackageMirroring }} - isDryRun: ${{ parameters.isDryRun }} - -- stage: NotificationApproval - displayName: Approval - Partner notification - dependsOn: Mirror - jobs: - - deployment: NotificationApproval - pool: server - displayName: Confirm partner notification sent - ${{ if parameters.isDryRun }}: - environment: pr - ${{ if not(parameters.isDryRun) }}: - environment: Source Build Release - Partner Notification - -- stage: ReleaseApproval - displayName: Approval - Release - dependsOn: NotificationApproval - jobs: - - deployment: ReleaseApproval - pool: server - displayName: Confirm Microsoft build released - ${{ if parameters.isDryRun }}: - environment: pr - ${{ if not(parameters.isDryRun) }}: - environment: Source Build Release - Release - -- template: templates/stages/release.yml - parameters: - dotnetStagingPipelineResource: dotnet-staging-pipeline-resource - dotnetMajorVersion: ${{ parameters.dotnetMajorVersion }} - releaseName: ${{ parameters.releaseName }} - releaseBranchName: ${{ parameters.releaseBranchName }} - isPreviewRelease: ${{ parameters.isPreviewRelease }} - createReleaseAnnouncement: ${{ parameters.createReleaseAnnouncement }} - announcementGist: ${{ replace(parameters.announcementGist, ' ', '') }} - createGitHubRelease: ${{ parameters.createGitHubRelease }} - submitReleasePR: ${{ parameters.submitReleasePR }} - isDryRun: ${{ parameters.isDryRun }} diff --git a/eng/source-build-release-pr.md b/eng/source-build-release-pr.md deleted file mode 100644 index 7583fc5c5a..0000000000 --- a/eng/source-build-release-pr.md +++ /dev/null @@ -1,5 +0,0 @@ - - -Title: .NET Source-Build $SDK_VERSION $RELEASE_DATE Updates - -Source-build updates for the .NET $RUNTIME_VERSION / $SDK_VERSION $RELEASE_DATE release. diff --git a/eng/submit-announcement.sh b/eng/submit-announcement.sh deleted file mode 100755 index 4ee991cd32..0000000000 --- a/eng/submit-announcement.sh +++ /dev/null @@ -1,243 +0,0 @@ -#!/bin/bash - -### Creates a release announcement in a form of a GitHub discussion in the target repository -### -### Options: -### --announcement-org The GitHub organization of the target repository -### --announcement-repo Target GitHub repository to create the announcement in -### --announcement-gist URL of a GitHub gist to take the announcement content from -### --channel Release channel, e.g. 8.0 -### --release Programmatic name of the release, e.g. 8.0.0.preview-1 -### --release-name Human readable name of the release, e.g. .NET 8 Preview 1 -### --sdk-version The .NET SDK version that is being released -### --runtime-version The .NET runtime version that is being released -### --tag The release tag, e.g. v8.0.0-preview.1 -### --dry-run (Optional) Runs a script in a dry-run mode that prints out the announcement only -### --prerelease (Optional) Whether this is a preview release -### --help, -h (Optional) Print this help message and exit - -set -euo pipefail -source="${BASH_SOURCE[0]}" - -function print_help () { - sed -n '/^### /,/^$/p' "$source" | cut -b 5- -} - -announcement_org='' -announcement_repo='' -announcement_gist='' -channel='' -release='' -release_name='' -sdk_version='' -runtime_version='' -tag='' -prerelease=false -dry_run=false - -while [[ $# -gt 0 ]]; do - opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -h | --help ) - print_help - exit 0 - ;; - --announcement-org ) - announcement_org="$2" - shift 2 - ;; - --announcement-repo ) - announcement_repo="$2" - shift 2 - ;; - --announcement-gist ) - announcement_gist="$2" - shift 2 - ;; - --channel ) - channel="$2" - shift 2 - ;; - --release ) - release="$2" - shift 2 - ;; - --release-name ) - release_name="$2" - shift 2 - ;; - --sdk-version ) - sdk_version="$2" - shift 2 - ;; - --runtime-version ) - runtime_version="$2" - shift 2 - ;; - --tag ) - tag="$2" - shift 2 - ;; - --prerelease ) - prerelease=true - shift 1 - ;; - --dry-run ) - dry_run=true - shift 1 - ;; - *) - echo "Invalid argument $1" - exit 1 - ;; - esac -done - -: "${announcement_org:?Missing --announcement-org}" -: "${announcement_repo:?Missing --announcement-repo}" -: "${channel:?Missing --channel}" -: "${release:?Missing --release}" -: "${release_name:?Missing --release-name}" -: "${sdk_version:?Missing --sdk-version}" -: "${runtime_version:?Missing --runtime-version}" -: "${tag:?Missing --tag}" - -repo_query="query { - repository( - owner: \"$announcement_org\" - name: \"$announcement_repo\" - ) { - id - } -}" - -repo_id=$(gh api graphql -f query="$repo_query" --template '{{.data.repository.id}}') -echo "$announcement_org/$announcement_repo repo ID is $repo_id" - -categories_query="{ - repository(name: \"$announcement_repo\", owner: \"$announcement_org\") { - discussionCategories(first: 10) { - edges { - node { - id - name - } - } - } - } -}" - -category_id=$(gh api graphql -f query="$categories_query" --template '{{range .data.repository.discussionCategories.edges}}{{if eq .node.name "Announcements"}}{{.node.id}}{{end}}{{end}}' ) - -echo "Discussion category ID is $category_id" - -if [[ -z "$announcement_gist" ]]; then - echo "Loading announcement template from source-build-release-announcement.md" - - prerelease_arg='' - if [ "$prerelease" = true ]; then - prerelease_arg='--prerelease' - fi - - announcement=$("./create-announcement-draft.sh" \ - --template "source-build-release-announcement.md" \ - --channel "$channel" \ - $prerelease_arg \ - --release "$release" \ - --release-name "$release_name" \ - --runtime-version "$runtime_version" \ - --sdk-version "$sdk_version" \ - --tag "$tag") - - # Get the line in the template that is prefixed with "Title:" and remove the prefix - title=$(echo "$announcement" | grep "^Title:" | cut -d " " -f2-) - # Get the inverse of the above selection - body=$(echo "$announcement" | grep -v "^Title:") - -else - echo "Loading announcement template from gist $announcement_gist" - - # Get title from the gist name - set +o pipefail # gh fails with 141 but returns the correct output - - title="$(gh gist view "$announcement_gist" --raw | head -n 1)" - body="$(gh gist view "$announcement_gist" | tail -n +2)" - - if [[ -z "$title" ]]; then - echo "##vso[task.logissue type=error]Could not get title from gist $announcement_gist" - exit 1 - fi - - if [[ -z "$body" ]]; then - echo "##vso[task.logissue type=error]Could not get announcement text from gist $announcement_gist" - exit 1 - fi - - set -o pipefail -fi - -if [ "$dry_run" = true ]; then - set +x - echo -e "\n\n\n#########################\n\n" - echo "Doing a dry run, not submitting announcement." - echo -e "\n\n#########################\n\n\n" - echo "Announcement title: $title" - echo "Announcement body: $body" -else - # Checking for an already existing announcement - recent_discussions_query="query { - repository( - name: \"$announcement_repo\" - owner: \"$announcement_org\" - ) { - discussions( - last: 100 - categoryId: \"$category_id\" - orderBy: { field: UPDATED_AT, direction: DESC } - ) { - edges { - node { - title - url - } - } - } - } - }" - - recent_discussions=$(gh api graphql -f query="$recent_discussions_query") - duplicate_discussions=$(echo "$recent_discussions" | jq -r '.data.repository.discussions.edges[] | select(.node.title == "'"$title"'") | .node') - - if [[ -z "$duplicate_discussions" || "$duplicate_discussions" == "null" ]]; then - create_discussion_query=' - mutation ($repo_id: ID!, $category_id: ID!, $body: String!, $title: String!) { - createDiscussion( - input: { - repositoryId: $repo_id - categoryId: $category_id - body: $body - title: $title - } - ) { - discussion { - url - } - } - }' - - echo "Submitting announcement" - - create_discussion_url=$(gh api graphql \ - -F repo_id="$repo_id" \ - -F category_id="$category_id" \ - -F body="$body" \ - -F title="$title" \ - -f query="$create_discussion_query" \ - --template '{{.data.createDiscussion.discussion.url}}' ) - - echo "Announcement URL: $create_discussion_url" - else - duplicate_discussion_url=$(echo "$duplicate_discussions" | jq -r '.url') - echo "##vso[task.logissue type=warning]Announcement already exists ($duplicate_discussion_url). Skipping submission" - fi -fi diff --git a/eng/submit-source-build-release-pr.sh b/eng/submit-source-build-release-pr.sh deleted file mode 100755 index 713b88d415..0000000000 --- a/eng/submit-source-build-release-pr.sh +++ /dev/null @@ -1,213 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -time="$(date +%s)" - -print-help () -{ - echo "Submits a PR that updates the source-build artifacts version and -global.json dotnet version. Depends on jq, git, and the gh cli. The gh cli also -must be authenticated, otherwise the GH_TOKEN environment variable must be -set to a GitHub token that has permission to edit the forked repo and submit -a PR in the target repo." - echo - echo "Syntax: ./submit-source-build-release-pr.sh --target-repo dotnet/installer --fork-repo dotnet-sb-bot/installer --sdkVersion 6.0.101" - echo "options:" - echo "--targetRepo, -t The repo to submit the PR to" - echo "--forkRepo, -f The repo to submit the PR from" - echo "--sdkVersion, -v The .NET SDK version to update to" - echo "--title, -T The title of the PR" - echo "--body, -B The body of the PR" - echo "--sourceBuiltArtifactsFileName The name of the archive containing source build artifacts" - echo "--sdkArtifactFileName The name of the archive containing the source built SDK" - echo "--targetBranch, -b (Optional) branch to submit the PR to, calculated automatically otherwise" - echo "--globalJson, -g (Optional) path to the global.json file to update" - echo "--versionsProps, -p (Optional) path to the Versions.props file to update" - echo "--setupGitAuth, -G (Optional) set up git authentication using the gh CLI" - echo "--help, -h (Optional) print this help message and exit" - echo -} - -SHORT=t:f:v:T:B:b:g:p:Gh -LONG=targetRepo:,forkRepo:,sdkVersion:,title:,body:,targetBranch:,globalJson:,versionsProps:,sourceBuiltArtifactsFileName:,sdkArtifactFileName:,setupGitAuth,help - -OPTS=$(getopt --options $SHORT --long $LONG --name "$0" -- "$@") -if [ $? != 0 ] ; then echo "Failed to parse options." >&2 ; exit 1 ; fi -eval set -- "$OPTS" - -global_json_path='src/SourceBuild/content/global.json' -versions_props_path='src/SourceBuild/content/eng/Versions.props' -custom_target_branch='' -setup_git_auth='' -source_built_artifacts_file_name='' -sdk_artifact_file_name='' - -while true ; do - case "$1" in - -h | --help ) - print-help - exit 0 - ;; - -G | --setupGitAuth ) - setup_git_auth='true' - shift - ;; - -t | --targetRepo ) - target_repo="$2" - shift 2 - ;; - -f | --forkRepo ) - fork_repo="$2" - shift 2 - ;; - -v | --sdkVersion ) - sdk_version="$2" - shift 2 - ;; - -T | --title ) - title="$2" - shift 2 - ;; - -B | --body ) - body="$2" - shift 2 - ;; - -g | --globalJson ) - global_json_path="$2" - shift 2 - ;; - -p | --versionsProps ) - versions_props_path="$2" - shift 2 - ;; - -b | --targetBranch ) - custom_target_branch="$2" - shift 2 - ;; - --sourceBuiltArtifactsFileName ) - source_built_artifacts_file_name="$2" - shift 2 - ;; - --sdkArtifactFileName ) - sdk_artifact_file_name="$2" - shift 2 - ;; - -- ) - shift - break - ;; - *) - echo "Internal error! Are you missing required arguments?" - exit 1 - ;; - esac -done - -echo "target_repo = $target_repo" -echo "fork_repo = $fork_repo" -echo "sdk_version = $sdk_version" -echo "title = $title" -echo "body = $body" -echo "global_json_path = $global_json_path" -echo "versions_props_path = $versions_props_path" -echo "custom_target_branch = $custom_target_branch" -echo "setup_git_auth = $setup_git_auth" -echo "source_built_artifacts_file_name = $source_built_artifacts_file_name" -echo "sdk_artifact_file_name = $sdk_artifact_file_name" - - -if [[ ${setup_git_auth} == true ]]; then - echo "Setting up git auth" - gh auth setup-git -fi - -if [ -z "${custom_target_branch}" ]; then - pr_target_branch=$(echo "release/${sdk_version}" | sed 's/..$/xx/') -else - pr_target_branch="${custom_target_branch}" -fi - -fork_url="https://github.com/${fork_repo}" -upstream_url="https://github.com/${target_repo}" - -# clone forked repo -repo_dir="repo-${time}" # "dotnet-installer-${time}" -git clone "${fork_url}" "${repo_dir}" --depth 1 -cd "${repo_dir}" - -# set up upstream remote -git remote add upstream "${upstream_url}" -git fetch upstream "${pr_target_branch}" - -# checkout a new branch on fork -monthYear=$(date +"%b%Y" | sed 's/.*/\L&/') -new_branch_name="${sdk_version}-${monthYear}-source-build-${time}" -git checkout -b "${new_branch_name}" "upstream/${pr_target_branch}" - -# make pr changes -cat "$global_json_path" \ - | jq --unbuffered ".tools.dotnet=\"${sdk_version}\"" \ - | tee "$global_json_path.new" -mv "$global_json_path.new" "$global_json_path" - -# Function to modify the Version.props file -# Arguments: -# 1. Element name -# 2. Replacement pattern -# 3. Replacement value -function update_version_props() { - local element_name="$1" - local replacement_value="$2" - # This default pattern matches the entire content and replaces the entire content. - local replacement_pattern=${3:-".*"} - - # Fetch the content inside the element - local element=$(grep -oP "<$element_name>.*<\/$element_name>" "$versions_props_path") - if [ -z "$element" ]; then - echo "##vso[task.logissue type=error] Element '$element_name' not found in the Versions.props file." - exit 1 - fi - - local content=$(echo "$element" | sed -n "s/.*<$element_name>\(.*\)<\/$element_name>.*/\1/p") - - # Replace the target pattern with the replacement value in the content - local new_content=$(echo "$content" | sed "s|$replacement_pattern|$replacement_value|") - - # Update the XML file with the modified content - sed -i "s|$element|<$element_name>$new_content|" "$versions_props_path" - - echo "Replacing content of $element_name with $new_content" -} - -if [[ $sdk_version == "6"* || $sdk_version == "7"* ]]; then - update_version_props "PrivateSourceBuiltArtifactsPackageVersion" "$sdk_version" - if [[ $sdk_version == "7"* ]]; then - update_version_props "PrivateSourceBuiltSDKVersion" "$sdk_version" - fi -else - # This pattern matches a sequence of characters that does not contain any forward slashes, occurring at the end of the line. - # To replace very last part of the url - content_replacement_pattern="/[^/]*$" - update_version_props "PrivateSourceBuiltArtifactsUrl" "/$source_built_artifacts_file_name" "$content_replacement_pattern" - update_version_props "PrivateSourceBuiltSdkUrl_CentOS8Stream" "/$sdk_artifact_file_name" "$content_replacement_pattern" -fi - -git add "$global_json_path" "$versions_props_path" - -git config --global user.name "dotnet-sb-bot" -git config --global user.email "dotnet-sb-bot@microsoft.com" -git commit -m "update global.json and Versions.props for .NET SDK ${sdk_version}" - -# push changes to fork -git push -u origin "${new_branch_name}" - -readarray -d '/' -t fork_repo_split <<< "${fork_repo}" -fork_owner="${fork_repo_split[0]}" - -# create pull request -gh pr create \ - --head "${fork_owner}:${new_branch_name}" \ - --repo "${target_repo}" \ - --base "${pr_target_branch}" \ - --title "${title}" \ - --body "${body}" diff --git a/eng/templates/stages/mirror.yml b/eng/templates/stages/mirror.yml deleted file mode 100644 index cbbe344498..0000000000 --- a/eng/templates/stages/mirror.yml +++ /dev/null @@ -1,265 +0,0 @@ -parameters: -- name: dotnetMajorVersion - type: string -- name: releaseBranchName - type: string -- name: isPreviewRelease - type: boolean -- name: useCustomTag - type: boolean -- name: skipPackageMirroring - type: boolean -- name: isDryRun - type: boolean - default: false -- name: dotnetStagingPipelineResource - type: string - -stages: -- stage: Mirror - displayName: Mirror sources & packages - dependsOn: - - PreRelease - - MirrorApproval - - jobs: - - job: Mirror - displayName: Mirror sources & packages - variables: - - template: ../variables/pipelines.yml - - template: ../variables/msrc-storage-variables.yml - parameters: - isDryRun: ${{ parameters.isDryRun }} - - group: DotNet-Source-Build-All-Orgs-Source-Access - - name: RepoDir - value: vmr - - name: GitUser - value: dn-bot - - name: GitEmail - value: dn-bot@microsoft.com - - name: destinationUrl - value: https://dotnet-security-partners@dev.azure.com/dotnet-security-partners/dotnet/_git/dotnet - # Destination package feed. If this feed changes, you must also change feedServiceConnection to point to that feed. - - name: destinationPackageFeed - value: https://pkgs.dev.azure.com/dotnet-security-partners/dotnet/_packaging/dotnet/nuget/v3/index.json - - name: feedServiceConnection - value: 'dotnet-security-partners-dotnet-dotnet feed' - - name: packagesArtifactName - value: signed - - name: shippingPackages - value: 'shipping/packages' - - name: packagesDownloadLocation - value: $(PIPELINE.WORKSPACE)/${{ parameters.dotnetStagingPipelineResource }}/$(packagesArtifactName)/$(shippingPackages) - - name: releaseTag - value: $[ stageDependencies.PreRelease.PreRelease.outputs['ReadReleaseInfo.ReleaseTag'] ] - - name: sdkVersion - value: $[ stageDependencies.PreRelease.PreRelease.outputs['ReadReleaseInfo.SdkVersion'] ] - - name: runtimeVersion - value: $[ stageDependencies.PreRelease.PreRelease.outputs['ReadReleaseInfo.RuntimeVersion'] ] - - name: releaseChannel - value: $[ stageDependencies.PreRelease.PreRelease.outputs['ReadReleaseInfo.ReleaseChannel'] ] - - name: combinedSmokeTestPrereqsTarballPath - value: $(Pipeline.Workspace)/dotnet-smoke-test-prereqs-$(sdkVersion).tar.gz - - - ${{ if eq(parameters.dotnetMajorVersion, '6.0') }}: - - name: smokeTestPreReqsArtifactNameX64 - value: Build_Tarball_x64 CentOSStream9-Offline_Artifacts - - name: smokeTestPreReqsArtifactNameArm64 - value: Build_Tarball_arm64 Debian11-Offline_Artifacts - - ${{ if eq(parameters.dotnetMajorVersion, '7.0') }}: - - name: smokeTestPreReqsArtifactNameX64 - value: Build_Tarball_x64 CentOSStream9-Offline_Artifacts - - name: smokeTestPreReqsArtifactNameArm64 - value: Build_Tarball_arm64 Debian11-Offline_Artifacts - - ${{ if eq(parameters.dotnetMajorVersion, '8.0') }}: - - name: smokeTestPreReqsArtifactNameX64 - value: CentOSStream9_Offline_MsftSdk_x64_Artifacts - - name: smokeTestPreReqsArtifactNameArm64 - value: Ubuntu2204Arm64_Offline_MsftSdk_arm64_Artifacts - - - ${{ if or(eq(parameters.dotnetMajorVersion, '6.0'), eq(parameters.dotnetMajorVersion, '7.0')) }}: - - name: sourceUrl - value: https://dnceng@dev.azure.com/dnceng/internal/_git/security-partners-dotnet - - name: sourceVersion - value: $[ stageDependencies.PreRelease.PreRelease.outputs['AssociatedPipelineRuns.InstallerCommit'] ] - - name: officialBuildPipelineId - value: $(INSTALLER_TARBALL_BUILD_CI_PIPELINE_ID) - - name: officialBuildRunId - value: $[ stageDependencies.PreRelease.PreRelease.outputs['AssociatedPipelineRuns.InstallerTarballBuildRunId'] ] - - ${{ else }}: - - name: sourceUrl - value: https://dnceng@dev.azure.com/dnceng/internal/_git/dotnet-dotnet - - name: sourceVersion - value: $[ stageDependencies.PreRelease.PreRelease.outputs['AssociatedPipelineRuns.DotnetDotnetCommit'] ] - - name: officialBuildPipelineId - value: $(DOTNET_DOTNET_CI_PIPELINE_ID) - - name: officialBuildRunId - value: $[ stageDependencies.PreRelease.PreRelease.outputs['AssociatedPipelineRuns.DotnetDotnetRunId'] ] - - # We're using a different pool than the rest of the pipeline here to get more disk space - # More information here: https://github.com/dotnet/arcade/issues/13036 - pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals Build.Ubuntu.2004.Amd64 - - steps: - - script: | - set -euo pipefail - - repo_dir="$(Pipeline.Workspace)/$(RepoDir)" - git init "$repo_dir" - cd "$repo_dir" - - echo "Setting up git in $repo_dir repo for ${{ variables.sourceUrl }} -> ${{ variables.destinationUrl }}" - - git config --global user.name '${{ variables.GitUser }}' - git config --global user.email '${{ variables.GitEmail }}' - - source_url=$(echo '${{ variables.sourceUrl }}' | sed "s,https://.*@,https://${{ variables.GitUser }}:${AZDO_PAT}@,g") - destination_url=$(echo '${{ variables.destinationUrl }}' | sed "s,https://.*@,https://${{ variables.GitUser }}:${AZDO_PAT}@,g") - - git remote add source "${source_url}" - git remote add destination "${destination_url}" - displayName: Initialize repository - env: - AZDO_PAT: $(dn-bot-all-orgs-build-rw-code-rw) - - - script: | - set -euo pipefail - - branch_name="${{ parameters.releaseBranchName }}" - if [[ "$branch_name" == internal/* ]]; then - branch_name="${branch_name#internal/}" - fi - - echo "Mirroring $branch_name from ${{ variables.sourceUrl }} to ${{ variables.destinationUrl }}" - - if [[ "${{ parameters.dotnetMajorVersion }}" == '6.0' || "${{ parameters.dotnetMajorVersion }}" == '7.0' ]]; then - # For 6.0 and 7.0 we tag the release branch into which we merged the release PR - ref_to_tag="$branch_name" - else - # For 8.0+ we tag a given VMR commit - ref_to_tag="$(sourceVersion)" - fi - - git fetch source "$ref_to_tag" - git checkout "$ref_to_tag" - - tag_name="$(releaseTag)" - echo "Tagging $ref_to_tag as $tag_name" - - # Check if the tag already exists and points to the same commit - sha=$(git rev-parse HEAD) - - # When querying for tags we need to ensure match the whole line and not just a substring - # of the tag name. This avoids accidentally matching a new tag of v8.0.0 with an existing - # tag of v8.0.0-rc.2.23479.6, for example. This is accomplished by including the '$' character - # at the end of the query so that it matches the end of the line. We also need to account for - # recursive tags, which is why we use the '^{}' syntax. For example, the tags that we create - # actually have two tags associated with them: - # 083b8b9fe09d04205e87bca0b378e4a3ad74a239 refs/tags/v8.0.0-rc.1.23419.4 - # 113d797bc90104bb4f1cc51e1a462cf3d4ef18fc refs/tags/v8.0.0-rc.1.23419.4^{} - # We want to match on both. - tagGrepQuery="refs/tags/$tag_name\(\^{}\)\?$" - - # `grep -q` exits as soon as a match is found; if there are multiple matches - # `git ls-remote` would continue to output even after grep exits, resulting in a - # broken pipe error (exit code 141). Saving the result in a var fixes the issue - tags=$(git ls-remote --tags destination) - if echo "$tags" | grep -q "$tagGrepQuery"; then - echo "Tag $tag_name already exists, checking if it points to the same commit" - - if echo "$tags" | grep "$tagGrepQuery" | grep -q "$sha"; then - echo "Tag $tag_name already exists at $sha, skipping" - exit 0 - else - echo "Tag $tag_name already exists but does not point to a $sha, aborting" - echo "Existing tags:" - echo "$tags" - exit 1 - fi - fi - - message=".NET Source-build $(releaseTag)" - git tag "$tag_name" "$ref_to_tag" -m "$message" - - if [ "${{ parameters.isDryRun }}" = "True" ]; then - set +x - echo "Doing a dry run, not pushing the tag $tag_name / $ref_to_tag to ${{ variables.destinationUrl }}" - else - echo "Pushing tag $tag_name to ${{ variables.destinationUrl }}" - git push destination "$tag_name" - fi - workingDirectory: $(Pipeline.Workspace)/$(RepoDir) - displayName: Mirror & tag sources - - - ${{ if not(parameters.skipPackageMirroring) }}: - # Download all shipping nupks from the staging pipeline. - # These should come from the signed directory, because in 6.0 post-build signing - # means that the 'signed' and 'shipping' artifacts are different in content. - - download: ${{ parameters.dotnetStagingPipelineResource }} - artifact: ${{ variables.packagesArtifactName }} - patterns: ${{ variables.shippingPackages }}/* - displayName: Download shipping packages - - # Then, upload these to DSP. - - ${{ if parameters.isDryRun }}: - # List the packages that would be pushed - - script: | - echo "Would push the following packages to $(destinationPackageFeed)" - find $(packagesDownloadLocation) -name '*.nupkg' - displayName: Publish packages to ${{ variables.destinationPackageFeed }} - - - ${{ else }}: - - script: sudo apt update && DEBIAN_FRONTEND=noninteractive sudo apt install -y apt-transport-https mono-complete nuget - displayName: Install NuGet and dependencies - - task: NuGetAuthenticate@1 - displayName: Authenticate to ${{ variables.destinationPackageFeed }} - inputs: - nuGetServiceConnections: ${{ variables.feedServiceConnection }} - - task: NuGetCommand@2 - displayName: Publish packages to ${{ variables.destinationPackageFeed }} - inputs: - command: push - packagesToPush: '${{ variables.packagesDownloadLocation }}/*.nupkg' - nuGetFeedType: external - publishFeedCredentials: ${{ variables.feedServiceConnection }} - allowPackageConflicts: true - - - template: ../steps/download-smoke-test-prereqs.yml - parameters: - officialBuildPipelineId: $(officialBuildPipelineId) - officialBuildRunId: $(officialBuildRunId) - taskLabel: x64 - artifactName: $(smokeTestPreReqsArtifactNameX64) - - - template: ../steps/download-smoke-test-prereqs.yml - parameters: - officialBuildPipelineId: $(officialBuildPipelineId) - officialBuildRunId: $(officialBuildRunId) - taskLabel: arm64 - artifactName: $(smokeTestPreReqsArtifactNameArm64) - - - script: | - "$(Build.SourcesDirectory)/eng/combine-tarballs.sh" \ - --output "$(combinedSmokeTestPrereqsTarballPath)" \ - $(Pipeline.Workspace)/dotnet-smoke-test-prereqs.*.tar.gz - displayName: Combine smoke test prereqs tarballs - - # Install requirements needed to upload to blob storage - # These aren't included by default in the agent image - - script: | - curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash && \ - sudo apt-get update && \ - sudo apt-get install -y \ - jq - displayName: Install upload prereqs - - - template: ../steps/upload-to-blob-storage.yml - parameters: - file: $(combinedSmokeTestPrereqsTarballPath) - accountName: $(storageAccountName) - containerName: $(blobContainerName) - uploadPath: $(blobContainerUploadBaseFilePath)/$(releaseChannel)/$(runtimeVersion)-$(sdkVersion) - azureStorageKey: $(dotnetclimsrc-access-key) - contentType: $(TARBALL_BLOB_CONTENT_TYPE) diff --git a/eng/templates/stages/pre-release.yml b/eng/templates/stages/pre-release.yml deleted file mode 100644 index 121de41f47..0000000000 --- a/eng/templates/stages/pre-release.yml +++ /dev/null @@ -1,135 +0,0 @@ -parameters: -- name: dotnetMajorVersion - displayName: Major .NET version being released - type: string - values: [ '6.0', '7.0', '8.0' ] -- name: isPreviewRelease - displayName: Preview release - type: boolean -- name: releaseBranchName - displayName: Release branch name (e.g. release/8.0.1xx-preview1) - type: string -- name: releaseName - displayName: Release name (e.g. ".NET 8.0 Preview 1") - type: string -- name: dotnetStagingPipelineResource - type: string -- name: useSpecificPipelineRunIDs - displayName: Use specific pipeline run IDs - type: boolean - default: false -- name: dotnetDotnetRunID - displayName: '[⚠️ 8.0] Specific dotnet-dotnet run ID' - type: string - default: '200XXXX.Y' -- name: dotnetInstallerOfficialRunID - displayName: '[⚠️ 6.0 / 7.0] Specific dotnet-installer-official-ci run ID' - type: string - default: '200XXXX.Y' -- name: dotnetInstallerTarballBuildRunID - displayName: '[⚠️ 6.0 / 7.0] Specific dotnet-installer-source-build-tarball-build run ID' - type: string - default: '200XXXX.Y' -- name: verifyBuildSuccess - displayName: Verify that associated pipeline runs succeeded - type: boolean - default: true -- name: useCustomTag - type: boolean -- name: customTag - type: string -- name: isDryRun - displayName: Dry Run - type: boolean - default: false - -stages: -- stage: PreRelease - displayName: Pre-Release - jobs: - - job: PreRelease - ${{ if or(eq(parameters.dotnetMajorVersion, '6.0'), eq(parameters.dotnetMajorVersion, '7.0')) }}: - displayName: Get build info & push tarball - ${{ else }}: - displayName: Get build info - variables: - - template: ../variables/pipelines.yml - - template: ../variables/msrc-storage-variables.yml - parameters: - isDryRun: ${{ parameters.isDryRun }} - - name: vmrUpstreamUrl - value: https://dnceng@dev.azure.com/dnceng/internal/_git/security-partners-dotnet - - steps: - - template: ../steps/initialize-release-info.yml - parameters: - dotnetStagingPipelineResource: dotnet-staging-pipeline-resource - dotnetMajorVersion: ${{ parameters.dotnetMajorVersion }} - releaseBranchName: ${{ parameters.releaseBranchName }} - useSpecificPipelineRunIDs: ${{ parameters.useSpecificPipelineRunIDs }} - dotnetDotnetRunID: ${{ parameters.dotnetDotnetRunID }} - dotnetInstallerOfficialRunID: ${{ parameters.dotnetInstallerOfficialRunID }} - dotnetInstallerTarballBuildRunID: ${{ parameters.dotnetInstallerTarballBuildRunID }} - verifyBuildSuccess: ${{ parameters.verifyBuildSuccess }} - useCustomTag: ${{ parameters.useCustomTag }} - customTag: ${{ replace(parameters.customTag, ' ', '') }} - isDryRun: ${{ parameters.isDryRun }} - - - script: | - prerelease='' - if [ ${{ parameters.isPreviewRelease }} = True ]; then - prerelease='--prerelease' - fi - - "$(Build.SourcesDirectory)/eng/create-announcement-draft.sh" \ - --template "$(Build.SourcesDirectory)/eng/source-build-release-announcement.md" \ - --release-name '${{ parameters.releaseName }}' \ - --channel "$(ReadReleaseInfo.ReleaseChannel)" \ - $prerelease \ - --release "$(ReadReleaseInfo.Release)" \ - --sdk-version "$(ReadReleaseInfo.SdkVersion)" \ - --runtime-version "$(ReadReleaseInfo.RuntimeVersion)" \ - --tag "$(ReadReleaseInfo.ReleaseTag)" - displayName: Create announcement draft - - - ${{ if or(eq(parameters.dotnetMajorVersion, '6.0'), eq(parameters.dotnetMajorVersion, '7.0')) }}: - - task: DownloadPipelineArtifact@2 - name: DownloadSourceTarballStep - displayName: Download Source Tarball - inputs: - source: specific - artifact: BlobArtifacts - patterns: BlobArtifacts/dotnet-sdk-source-$(ReadReleaseInfo.SdkVersion).tar.gz - project: $(AZDO_PROJECT) - pipeline: $(INSTALLER_OFFICIAL_CI_PIPELINE_ID) - runVersion: specific - runId: $(AssociatedPipelineRuns.InstallerOfficialRunId) - - - template: ../steps/upload-to-blob-storage.yml - parameters: - file: $(PIPELINE.WORKSPACE)/dotnet-sdk-source-$(ReadReleaseInfo.SdkVersion).tar.gz - accountName: $(storageAccountName) - containerName: $(blobContainerName) - uploadPath: $(blobContainerUploadBaseFilePath)/$(ReadReleaseInfo.ReleaseChannel)/$(ReadReleaseInfo.RuntimeVersion)-$(ReadReleaseInfo.SdkVersion) - azureStorageKey: $(dotnetclimsrc-access-key) - contentType: $(TARBALL_BLOB_CONTENT_TYPE) - - - script: | - set -euo pipefail - - upstream_with_pat=$(echo $(vmrUpstreamUrl) | sed "s,https://.*@,https://dn-bot:${AZDO_PAT}@,g") - - args=() - args+=(--releaseChannel $(ReadReleaseInfo.ReleaseChannel)) - args+=(--sdkVersion $(ReadReleaseInfo.SdkVersion)) - args+=(--upstream ${upstream_with_pat}) - args+=(--tarball $(Pipeline.Workspace)/dotnet-sdk-source-$(ReadReleaseInfo.SdkVersion).tar.gz) - - if [ '${{ parameters.isDryRun }}' = True ]; then - args+=(--isDryRun) - fi - - $(Build.SourcesDirectory)/eng/push-tarball.sh "${args[@]}" - displayName: Update security-partners-dotnet - env: - AZDO_PAT: $(dn-bot-all-orgs-build-rw-code-rw) \ No newline at end of file diff --git a/eng/templates/stages/release.yml b/eng/templates/stages/release.yml deleted file mode 100644 index 3f8a52a731..0000000000 --- a/eng/templates/stages/release.yml +++ /dev/null @@ -1,423 +0,0 @@ -parameters: -- name: dotnetStagingPipelineResource - type: string -- name: dotnetMajorVersion - type: string -- name: isPreviewRelease - type: boolean -- name: releaseName - type: string -- name: releaseBranchName - type: string -- name: createReleaseAnnouncement - type: boolean - default: true -- name: announcementGist - type: string -- name: submitReleasePR - type: boolean - default: true -- name: createGitHubRelease - type: string -- name: isDryRun - type: boolean - default: false - -stages: -- stage: Release - displayName: Release - dependsOn: - - PreRelease - - ReleaseApproval - - variables: - - template: ../variables/pipelines.yml - - - group: DotNet-Source-Build-Bot-Secrets - - group: DotNet-DotNetCli-Storage - - group: DotNetBot-GitHub-AllBranches - - - name: releasePrRepo - value: dotnet/installer - - name: vmrPublicRepo - value: dotnet/dotnet - - name: vmrPublicUrl - value: https://github.com/$(vmrPublicRepo) - - name: releasePrForkRepo - value: dotnet-sb-bot/installer - - name: announcementOrg - value: dotnet - - name: announcementRepo - value: source-build - - name: storageAccountName - value: dotnetcli - - name: blobContainerName - value: source-built-artifacts - - name: artifactsUploadBaseFilePath - ${{ if parameters.isDryRun }}: - value: testing - ${{ else }}: - value: assets - - name: sdkUploadBaseFilePath - ${{ if parameters.isDryRun }}: - value: testing - ${{ else }}: - value: sdks - - name: Codeql.Enabled - value: true - - - ${{ if eq(parameters.dotnetMajorVersion, '6.0') }}: - - name: sourceBuildArtifactLeg - value: Build_Tarball_x64 CentOS7-Offline_Artifacts - - name: sourceBuiltArtifactsFileName - value: Private.SourceBuilt.Artifacts.$(sdkVersion).centos.7-x64.tar.gz - - name: sdkArtifactFileName - value: dotnet-sdk-$(sdkVersion)-*.tar.gz - - - ${{ if eq(parameters.dotnetMajorVersion, '7.0') }}: - - name: sourceBuildArtifactLeg - value: Build_Tarball_x64 CentOSStream8-Offline_Artifacts - - name: sourceBuiltArtifactsFileName - value: Private.SourceBuilt.Artifacts.$(sdkVersion).centos.8-x64.tar.gz - - name: sdkArtifactFileName - value: dotnet-sdk-$(sdkVersion)-*.tar.gz - - - ${{ if eq(parameters.dotnetMajorVersion, '8.0') }}: - - name: sourceBuildArtifactLeg - value: CentOSStream8_Offline_MsftSdk_x64_Artifacts - - name: sourceBuiltArtifactsFileName - value: Private.SourceBuilt.Artifacts.*.centos.8-x64.tar.gz - - name: sdkArtifactFileName - value: dotnet-sdk-*.tar.gz - - # GitHub release is skipped for 6.0/7.0 and dry runs - - name: createGitHubRelease - ${{ if eq(parameters.createGitHubRelease, 'auto') }}: - ${{ if or(parameters.isDryRun, eq(parameters.dotnetMajorVersion, '6.0'), eq(parameters.dotnetMajorVersion, '7.0')) }}: - value: skip - ${{ else }}: - value: full - ${{ else }}: - value: ${{ parameters.createGitHubRelease }} - - # Variables from the Pre-Release stage - - name: release - value: $[ stageDependencies.PreRelease.PreRelease.outputs['ReadReleaseInfo.Release'] ] - - name: sdkVersion - value: $[ stageDependencies.PreRelease.PreRelease.outputs['ReadReleaseInfo.SdkVersion'] ] - - name: runtimeVersion - value: $[ stageDependencies.PreRelease.PreRelease.outputs['ReadReleaseInfo.RuntimeVersion'] ] - - name: releaseChannel - value: $[ stageDependencies.PreRelease.PreRelease.outputs['ReadReleaseInfo.ReleaseChannel'] ] - - name: releaseTag - value: $[ stageDependencies.PreRelease.PreRelease.outputs['ReadReleaseInfo.ReleaseTag'] ] - - - ${{ if or(eq(parameters.dotnetMajorVersion, '6.0'), eq(parameters.dotnetMajorVersion, '7.0')) }}: - - name: officialBuildPipelineId - value: $(INSTALLER_TARBALL_BUILD_CI_PIPELINE_ID) - - name: officialBuildRunId - value: $[ stageDependencies.PreRelease.PreRelease.outputs['AssociatedPipelineRuns.InstallerTarballBuildRunId'] ] - - ${{ else }}: - - name: officialBuildPipelineId - value: $(DOTNET_DOTNET_CI_PIPELINE_ID) - - name: officialBuildRunId - value: $[ stageDependencies.PreRelease.PreRelease.outputs['AssociatedPipelineRuns.DotnetDotnetRunId'] ] - - name: dotnetDotnetCommit - value: $[ stageDependencies.PreRelease.PreRelease.outputs['AssociatedPipelineRuns.DotnetDotnetCommit'] ] - - jobs: - - job: Release - displayName: Announcements, PRs & Release - steps: - - checkout: self - path: dotnet-source-build - - - ${{ if and(ne(variables.createGitHubRelease, 'skip'), ne(parameters.dotnetMajorVersion, '6.0'), ne(parameters.dotnetMajorVersion, '7.0')) }}: - - checkout: dotnet-dotnet - displayName: Checkout dotnet-dotnet - path: dotnet-dotnet - fetchDepth: 0 - fetchTags: true - - - script: | - git_user=dotnet-bot - git_email=dotnet-bot@microsoft.com - - git config --global user.name "$git_user" - git config --global user.email "$git_email" - - vmr_url="https://$git_user:${GH_TOKEN}@github.com/$(vmrPublicRepo)" - - if git fetch "$vmr_url" tag "$(releaseTag)" --quiet --no-tags; then - # Tag exists, we need to verify that the correct commit is tagged - tagged_commit=$(git rev-list -1 "refs/tags/$(releaseTag)") - if [[ "$tagged_commit" != "$(dotnetDotnetCommit)" ]]; then - echo "##vso[task.logissue type=error]The release tag '$(releaseTag)' is linked to a different commit. Expected: '$(dotnetDotnetCommit)'; Actual: '$tagged_commit'" - echo "##vso[task.logissue type=error]See the tag at $(vmrPublicUrl)/releases/tag/$(releaseTag) for more info." - exit 1 - fi - - echo "Tag already exists and is referencing the correct commit" - else - # Tag does not exist, we need to tag the commit and push it - echo "Pushing release tag to $(vmrPublicRepo)" - git tag "$(releaseTag)" "$(dotnetDotnetCommit)" - git push "$vmr_url" "refs/tags/$(releaseTag)" - if [[ $? != 0 ]]; then - echo "##vso[task.logissue type=error]Failed to create a GitHub tag for the release" - exit 1 - fi - fi - displayName: Tag and push build commit - workingDirectory: $(Agent.BuildDirectory)/dotnet-dotnet - env: - GH_TOKEN: $(BotAccount-dotnet-bot-repo-PAT) - - - script: | - set -euo pipefail - - prerelease='' - if [ "${{ parameters.isPreviewRelease }}" = True ]; then - prerelease='--prerelease' - fi - - draft='' - if [ "${{ variables.createGitHubRelease }}" = draft ]; then - draft='--draft' - fi - - release_json="$(Build.ArtifactStagingDirectory)/release.json" - - echo "{}" \ - | jq '. += { "release": "$(release)" }' \ - | jq '. += { "channel": "$(releaseChannel)" }' \ - | jq '. += { "tag": "$(releaseTag)" }' \ - | jq '. += { "sdkVersion": "$(sdkVersion)" }' \ - | jq '. += { "runtimeVersion": "$(runtimeVersion)" }' \ - | jq '. += { "sourceRepository": "$(vmrPublicUrl)" }' \ - | jq '. += { "sourceVersion": "$(dotnetDotnetCommit)" }' \ - > "$release_json" - - echo -e "\n\nGenerated release.json:\n\n" - cat "$release_json" - - release_notes="$(Build.ArtifactStagingDirectory)/release_notes.md" - - ./create-announcement-draft.sh \ - --template "source-build-release-notes.md" \ - --channel "$(releaseChannel)" \ - $prerelease \ - --release "$(release)" \ - --release-name "${{ parameters.releaseName }}" \ - --runtime-version "$(runtimeVersion)" \ - --sdk-version "$(sdkVersion)" \ - --tag "$(releaseTag)" \ - --source-version "$(dotnetDotnetCommit)" \ - > "$release_notes" - - echo -e "\n\nGenerated release notes:\n\n" - cat "$release_notes" - - echo -e "\n\nCreating GitHub release..." - - set +e - result=$(gh release create "$(releaseTag)" \ - "$release_json#Release manifest" \ - --repo "$(vmrPublicRepo)" \ - --title "${{ parameters.releaseName }}" \ - --notes-file "$release_notes" \ - --verify-tag \ - $prerelease \ - $draft \ - 2>&1) - - if [ $? -ne 0 ]; then - if [[ "$result" =~ "already exists" ]]; then - echo "##vso[task.logissue type=warning]GitHub release $(releaseTag) already exists ($(vmrPublicUrl)/releases/tag/$(releaseTag))" - else - echo "##vso[task.logissue type=error]Failed to create the GitHub release: $result" - exit 1 - fi - fi - displayName: Create GitHub release - workingDirectory: $(Agent.BuildDirectory)/dotnet-source-build/eng - env: - GH_TOKEN: $(BotAccount-dotnet-bot-repo-PAT) - - # Skip release tag validation for draft releases as the tag won't be immediately visible until the draft is published - - ${{ if or(eq(variables.createGitHubRelease, 'skip'), eq(variables.createGitHubRelease, 'full'), eq(parameters.dotnetMajorVersion, '6.0'), eq(parameters.dotnetMajorVersion, '7.0')) }}: - - script: | - set -euo pipefail - - if [[ "$(releaseChannel)" == '6.0' || "$(releaseChannel)" == '7.0' ]]; then - repo='installer' - else - repo='dotnet' - fi - - # Checks for all matching tags (there can be more, e.g. 7.0.100 will match 7.0.100-preview.1.21102.12) - query="{ repository(owner: \"dotnet\", name: \"$repo\") { refs(refPrefix: \"refs/tags/\", last: 100, query: \"$(releaseTag)\") { nodes { name }}}}" - tags=$(gh api graphql -f query="$query" --template '{{.data.repository.refs.nodes}}') - - # Find the exact match - if echo "$tags" | grep -q "map\[name:$(releaseTag)\]"; then - echo "Tag $(releaseTag) exists: https://github.com/dotnet/$repo/releases/tag/$(releaseTag)" - exit 0 - fi - - if [ ${{ parameters.isDryRun }} = True ]; then - echo "##vso[task.logissue type=warning]Tag $(releaseTag) does not exist in dotnet/$repo (possibly expected)" - exit 0 - fi - - echo "##vso[task.logissue type=error]Tag $(releaseTag) does not exist in dotnet/$repo" - exit 1 - displayName: Validate release tag - env: - GH_TOKEN: $(BotAccount-dotnet-sb-bot-pat) - - - ${{ if parameters.createReleaseAnnouncement }}: - - script: | - set -euo pipefail - - prerelease='' - if [ ${{ parameters.isPreviewRelease }} = True ]; then - prerelease='--prerelease' - fi - - dry_run='' - if [ ${{ parameters.isDryRun }} = True ]; then - dry_run='--dry-run' - fi - - set -x - ./submit-announcement.sh \ - --announcement-org dotnet \ - --announcement-repo source-build \ - --announcement-gist "${{ parameters.announcementGist }}" \ - --channel "$(releaseChannel)" \ - $dry_run \ - $prerelease \ - --release "$(release)" \ - --release-name "${{ parameters.releaseName }}" \ - --runtime-version "$(runtimeVersion)" \ - --sdk-version "$(sdkVersion)" \ - --tag "$(releaseTag)" - - displayName: Submit announcement discussion - workingDirectory: $(Agent.BuildDirectory)/dotnet-source-build/eng - env: - GH_TOKEN: $(BotAccount-dotnet-sb-bot-pat) - - - ${{ if parameters.submitReleasePR }}: - - task: DownloadPipelineArtifact@2 - name: DownloadSourceBuiltArtifactsStep - displayName: Download Source-Built Artifacts - inputs: - source: specific - project: $(AZDO_PROJECT) - pipeline: $(officialBuildPipelineId) - runVersion: specific - runId: $(officialBuildRunId) - artifact: $(sourceBuildArtifactLeg) - patterns: $(sourceBuiltArtifactsFileName) - - - task: DownloadPipelineArtifact@2 - name: DownloadSourceBuiltSDKStep - displayName: Download Source-Built SDK - inputs: - source: specific - project: $(AZDO_PROJECT) - pipeline: $(officialBuildPipelineId) - runVersion: specific - runId: $(officialBuildRunId) - artifact: $(sourceBuildArtifactLeg) - patterns: $(sdkArtifactFileName) - - - template: ../steps/upload-to-blob-storage.yml - parameters: - file: $(PIPELINE.WORKSPACE)/$(sourceBuiltArtifactsFileName) - accountName: $(storageAccountName) - containerName: $(blobContainerName) - uploadPath: $(artifactsUploadBaseFilePath) - azureStorageKey: $(dotnetcli-storage-key) - contentType: $(TARBALL_BLOB_CONTENT_TYPE) - - - template: ../steps/upload-to-blob-storage.yml - parameters: - file: $(PIPELINE.WORKSPACE)/$(sdkArtifactFileName) - accountName: $(storageAccountName) - containerName: $(blobContainerName) - uploadPath: $(sdkUploadBaseFilePath) - azureStorageKey: $(dotnetcli-storage-key) - contentType: $(TARBALL_BLOB_CONTENT_TYPE) - - - script: | - set -euo pipefail - - export RELEASE_DATE=$(date +"%B %Y") # e.g. "March 2022" - export RUNTIME_VERSION="$(runtimeVersion)" - export SDK_VERSION="$(sdkVersion)" - - template="$(envsubst < source-build-release-pr.md)" - # Get the line in the template that is prefixed with "Title:" and remove the prefix - title=$(echo "$template" | grep "^Title:" | cut -d " " -f2-) - # Get the inverse of the above selection - body=$(echo "$template" | grep -v "^Title:") - - echo "TargetRepo: $(releasePrRepo)" - echo "ForkRepo: $(releasePrForkRepo)" - echo "SdkVersion: $(sdkVersion)" - echo "Title: $title" - echo "Body: $body" - - extraArgs=() - if [[ "$(releaseChannel)" == '6.0' || "$(releaseChannel)" == '7.0' ]]; then - extraArgs+=("--globalJson" "src/SourceBuild/tarball/content/global.json") - extraArgs+=("--versionsProps" "eng/Versions.props") - fi - - if [ "${{ parameters.isPreviewRelease }}" = True ]; then - target_branch='main' - else - target_branch="${{ parameters.releaseBranchName }}" - if [[ "$target_branch" == internal/* ]]; then - target_branch="${target_branch#internal/}" - fi - fi - - # We get the actual final version from the file names - it differs as it comes from the VMR build, not from the official installer one - resolvedSourceBuiltArtifactsFileName=$(basename $(PIPELINE.WORKSPACE)/$(sourceBuiltArtifactsFileName)) - resolvedSdkArtifactFileName=$(basename $(PIPELINE.WORKSPACE)/$(sdkArtifactFileName)) - - if [ "${{ parameters.isDryRun }}" = True ]; then - echo "Doing a dry run, not submitting PR. Would have called:" - echo "./submit-source-build-release-pr.sh" - echo " --setupGitAuth" - echo " --targetRepo $(releasePrRepo)" - echo " --forkRepo $(releasePrForkRepo)" - echo " --sdkVersion $(sdkVersion)" - echo " --title $title" - echo " --body $body" - echo " --targetBranch $target_branch" - echo " --sdkArtifactFileName $resolvedSdkArtifactFileName" - echo " --sourceBuiltArtifactsFileName $resolvedSourceBuiltArtifactsFileName" - echo " ${extraArgs[@]}" - else - echo "Submitting PR" - ./submit-source-build-release-pr.sh \ - --setupGitAuth \ - --targetRepo "$(releasePrRepo)" \ - --forkRepo "$(releasePrForkRepo)" \ - --sdkVersion "$(sdkVersion)" \ - --title "$title" \ - --body "$body" \ - --targetBranch "$target_branch" \ - --sdkArtifactFileName "$resolvedSdkArtifactFileName" \ - --sourceBuiltArtifactsFileName "$resolvedSourceBuiltArtifactsFileName" \ - "${extraArgs[@]}" - fi - displayName: Submit Release PR - workingDirectory: $(Agent.BuildDirectory)/dotnet-source-build/eng - env: - GH_TOKEN: $(BotAccount-dotnet-sb-bot-pat) diff --git a/eng/templates/steps/download-smoke-test-prereqs.yml b/eng/templates/steps/download-smoke-test-prereqs.yml deleted file mode 100644 index e58ba1c6dc..0000000000 --- a/eng/templates/steps/download-smoke-test-prereqs.yml +++ /dev/null @@ -1,21 +0,0 @@ -parameters: -- name: taskLabel - type: string -- name: artifactName - type: string -- name: officialBuildPipelineId - type: string -- name: officialBuildRunId - type: string - -steps: -- task: DownloadPipelineArtifact@2 - displayName: Download Smoke Test Prereqs (${{ parameters.taskLabel }}) - inputs: - source: specific - artifact: ${{ parameters.artifactName }} - patterns: dotnet-smoke-test-prereqs.*.tar.gz - project: $(AZDO_PROJECT) - pipeline: ${{ parameters.officialBuildPipelineId }} - runVersion: specific - runId: ${{ parameters.officialBuildRunId}} diff --git a/eng/templates/steps/initialize-release-info.yml b/eng/templates/steps/initialize-release-info.yml deleted file mode 100644 index 7811e0ed04..0000000000 --- a/eng/templates/steps/initialize-release-info.yml +++ /dev/null @@ -1,179 +0,0 @@ -parameters: -- name: dotnetStagingPipelineResource - type: string -- name: dotnetMajorVersion - type: string -- name: releaseBranchName - type: string -- name: useSpecificPipelineRunIDs - type: boolean - default: false -- name: dotnetInstallerOfficialRunID - type: string - default: '' -- name: dotnetInstallerTarballBuildRunID - type: string - default: '' -- name: dotnetDotnetRunID - type: string - default: '' -- name: verifyBuildSuccess - type: boolean -- name: useCustomTag - type: boolean - default: false -- name: customTag - type: string -- name: isDryRun - type: boolean - default: false - -steps: -- download: ${{ parameters.dotnetStagingPipelineResource }} - artifact: manifests - patterns: manifest.json - displayName: Download Release Manifest - -- download: ${{ parameters.dotnetStagingPipelineResource }} - artifact: drop - patterns: config.json - displayName: Download Release Config - -- script: | - set -euo pipefail - - manifest_path=$(PIPELINE.WORKSPACE)/dotnet-staging-pipeline-resource/manifests/manifest.json - config_path=$(PIPELINE.WORKSPACE)/dotnet-staging-pipeline-resource/drop/config.json - - runtime_version="$(jq -r '.Runtime' "$config_path")" - release_channel="$(jq -r '.Channel' "$config_path")" - release="$(jq -r '.Release' "$config_path")" - - # Source-build only supports the lowest available feature band. - # Sort the SDK releases by number and pick the lowest value. - # We also need to remove the preview label from the version - sdk_version="$(jq -r '.Sdks | sort_by(. | split(".") | map(sub("-[a-z0-9]+"; "")) | map(tonumber)) | .[0]' $config_path)" - - branch_name="${{ parameters.releaseBranchName }}" - if [ -z "$branch_name" ]; then - # For non-preview releases, the branch name can be determined from the SDK version - # Replace the last two characters in sdk_version with xx - branch_version=$(echo $sdk_version | sed 's/..$/xx/') - branch_name="refs/heads/internal/release/${branch_version}" - fi - - if [[ ! "$branch_name" =~ ^refs/heads/ ]]; then - branch_name="refs/heads/$branch_name" - fi - - commit=$(jq -r --arg BRANCH "$branch_name" '.builds[] | select(.repo == "https://dev.azure.com/dnceng/internal/_git/dotnet-installer" or .repo == "https://github.com/dotnet/installer") | select(.branch == $BRANCH) | .commit' $manifest_path) - - if [[ ! $commit ]]; then - echo "##vso[task.logissue type=error]Installer build on a commit for branch $branch_name not found. Exiting..." - exit 1 - fi - - if [ "${{ parameters.useCustomTag }}" = "True" ] ; then - tag="${{ parameters.customTag }}" - echo "Using custom tag $tag" - else - if [[ "${{ parameters.dotnetMajorVersion }}" == '6.0' || "${{ parameters.dotnetMajorVersion }}" == '7.0' ]]; then - tag="v$sdk_version" - else - tag="v$runtime_version" - fi - fi - - echo "Release: $release" - echo "Release channel: $release_channel" - echo "Runtime version: $runtime_version" - echo "Release tag: $tag" - echo "SDK version: $sdk_version" - echo "Installer commit: $commit" - - echo "##vso[task.setvariable variable=Release;isOutput=true]$release" - echo "##vso[task.setvariable variable=SdkVersion;isOutput=true]$sdk_version" - echo "##vso[task.setvariable variable=RuntimeVersion;isOutput=true]$runtime_version" - echo "##vso[task.setvariable variable=ReleaseChannel;isOutput=true]$release_channel" - echo "##vso[task.setvariable variable=ReleaseTag;isOutput=true]$tag" - echo "##vso[task.setvariable variable=InstallerCommit;isOutput=true]$commit" - - build_name="$(resources.pipeline.dotnet-staging-pipeline-resource.runName)" - if [ ${{ parameters.isDryRun }} = True ]; then - build_name="dryrun-${build_name}" - fi - - original_build_name='$(Build.BuildNumber)' - revision="${original_build_name:9}" - - # Tag & name the release build - echo "##vso[build.updatebuildnumber]$build_name-$revision" - echo "##vso[build.addbuildtag]$release" - if [ '${{ parameters.isDryRun }}' = True ]; then - echo "##vso[build.addbuildtag]dry-run" - fi - name: ReadReleaseInfo - displayName: Read Release Info - -- script: | - set -euo pipefail - source eng/get-build-info.sh - - if [[ "$(ReadReleaseInfo.ReleaseChannel)" == "6.0" || "$(ReadReleaseInfo.ReleaseChannel)" == "7.0" ]]; then - if [[ "${{ parameters.useSpecificPipelineRunIDs }}" == "True" ]]; then - search_by=name - query1="${{ parameters.dotnetInstallerOfficialRunID }}" - query2="${{ parameters.dotnetInstallerTarballBuildRunID }}" - echo "Searching for associated builds $query1 and $query2" - else - search_by=sourceVersion - query1="$(ReadReleaseInfo.InstallerCommit)" - query2="$(ReadReleaseInfo.InstallerCommit)" - fi - - get_build_info \ - "$(AZDO_ORG)" \ - "$(AZDO_PROJECT)" \ - "$(INSTALLER_OFFICIAL_CI_PIPELINE_ID)" \ - dotnet-installer-official-ci \ - InstallerOfficialRunId \ - InstallerCommit \ - "${{ parameters.verifyBuildSuccess }}" \ - $search_by \ - "$query1" - - get_build_info \ - "$(AZDO_ORG)" \ - "$(AZDO_PROJECT)" \ - "$(INSTALLER_TARBALL_BUILD_CI_PIPELINE_ID)" \ - dotnet-installer-source-build-tarball-build \ - InstallerTarballBuildRunId \ - InstallerCommit \ - "${{ parameters.verifyBuildSuccess }}" \ - $search_by \ - "$query2" - else - if [[ "${{ parameters.useSpecificPipelineRunIDs }}" == "True" ]]; then - search_by=name - query="${{ parameters.dotnetDotnetRunID }}" - echo "Searching for associated build $query" - else - search_by=tag - query="installer-$(ReadReleaseInfo.InstallerCommit)" - fi - - get_build_info \ - "$(AZDO_ORG)" \ - "$(AZDO_PROJECT)" \ - "$(DOTNET_DOTNET_CI_PIPELINE_ID)" \ - dotnet-dotnet \ - DotnetDotnetRunId \ - DotnetDotnetCommit \ - "${{ parameters.verifyBuildSuccess }}" \ - $search_by \ - "$query" - fi - name: AssociatedPipelineRuns - displayName: Get associated pipeline runs - env: - AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) diff --git a/eng/templates/steps/upload-to-blob-storage.yml b/eng/templates/steps/upload-to-blob-storage.yml deleted file mode 100644 index 07caac431b..0000000000 --- a/eng/templates/steps/upload-to-blob-storage.yml +++ /dev/null @@ -1,51 +0,0 @@ -parameters: - - name: file - type: string - - name: accountName - type: string - - name: containerName - type: string - - name: uploadPath - type: string - - name: azureStorageKey - type: string - - name: contentType - type: string - -steps: -- script: | - set -euxo pipefail - az config set extension.use_dynamic_install=yes_without_prompt - - filename="$(basename ${{ parameters.file }})" - full_filepath="$(realpath ${{ parameters.file }})" - - # Check if the file is on disk - if [ ! -f "${full_filepath}" ]; then - echo "##vso[task.logissue type=error]File ${full_filepath} not found on disk. It might not have been downloaded. Exiting..." - fi - - # Check if the file already exists in blob storage - file_blob_list=$(az storage blob list --account-name "${{ parameters.accountName }}" --container-name "${{ parameters.containerName }}" --prefix "${{ parameters.uploadPath }}/${filename}") - number_of_blobs=$(echo $file_blob_list | jq -r 'length') - if [ $number_of_blobs -gt 0 ]; then - echo "##vso[task.logissue type=warning]There is already a blob named ${filename} found in blob storage. Skipping upload..." - echo "##vso[task.complete result=SucceededWithIssues;]DONE" - exit 0 - fi - - az storage blob upload --account-name "${{ parameters.accountName }}" --container-name "${{ parameters.containerName }}" --file "${full_filepath}" --name "${{ parameters.uploadPath }}/${filename}" --content-type "${{ parameters.contentType }}" - - # Check if the uploaded file is reachable in the blob storage account - file_blob_list=$(az storage blob list --account-name "${{ parameters.accountName }}" --container-name "${{ parameters.containerName }}" --prefix "${{ parameters.uploadPath }}/${filename}") - number_of_blobs=$(echo $file_blob_list | jq -r 'length') - if [ $number_of_blobs -eq 0 ]; then - echo "##vso[task.logissue type=error]File ${filename} not found in blob storage container after upload. It might not have been downloaded earlier, or might not have been uploaded to ${{ parameters.containerName }}. Exiting..." - exit 1 - elif [ $number_of_blobs -gt 1 ]; then - echo "##vso[task.logissue type=error]More than one blob named ${filename} found in blob storage. Exiting..." - exit 1 - fi - displayName: Upload To Blob Storage - env: - AZURE_STORAGE_KEY: ${{ parameters.azureStorageKey }} \ No newline at end of file diff --git a/eng/templates/variables/msrc-storage-variables.yml b/eng/templates/variables/msrc-storage-variables.yml deleted file mode 100644 index d9fcb0af61..0000000000 --- a/eng/templates/variables/msrc-storage-variables.yml +++ /dev/null @@ -1,16 +0,0 @@ -parameters: -- name: isDryRun - type: boolean - -variables: -- group: DotNet-MSRC-Storage -- group: DotNet-Source-Build-All-Orgs-Source-Access -- name: storageAccountName - value: dotnetclimsrc -- name: blobContainerName - value: source-build -- name: blobContainerUploadBaseFilePath - ${{ if parameters.isDryRun }}: - value: Dev - ${{ else }}: - value: release diff --git a/eng/templates/variables/pipelines.yml b/eng/templates/variables/pipelines.yml deleted file mode 100644 index b5c8e8fcd8..0000000000 --- a/eng/templates/variables/pipelines.yml +++ /dev/null @@ -1,14 +0,0 @@ -# Hardcoded information about already existing AzDO pipelines that is expected to not change -variables: -- name: AZDO_PROJECT - value: internal -- name: AZDO_ORG - value: https://dev.azure.com/dnceng/ -- name: INSTALLER_OFFICIAL_CI_PIPELINE_ID - value: 286 -- name: INSTALLER_TARBALL_BUILD_CI_PIPELINE_ID - value: 1011 -- name: DOTNET_DOTNET_CI_PIPELINE_ID - value: 1219 -- name: TARBALL_BLOB_CONTENT_TYPE - value: application/x-gzip