Skip to content

Commit

Permalink
Update distribution-scripts
Browse files Browse the repository at this point in the history
Updates `distribution-scripts` dependency to crystal-lang/distribution-scripts@1ee8983

This includes the following changes:

* crystal-lang/distribution-scripts#197
  • Loading branch information
straight-shoota committed Sep 19, 2022
1 parent 6c3305e commit 64d7bff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
distribution-scripts-version:
description: "Git ref for version of https://github.com/crystal-lang/distribution-scripts/"
type: string
default: "e9cafa1a93a487169e561759e9a2d065c35e0770"
default: "1ee8983d46c594f97b6fe70a711c5dbefe83ab45"
previous_crystal_base_url:
description: "Prefix for URLs to Crystal bootstrap compiler"
type: string
Expand Down
22 changes: 15 additions & 7 deletions scripts/update-distribution-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
#
# Usage:
#
# scripts/update-distribution_scripts.sh [REF]
# scripts/update-distribution_scripts.sh [REF] [BRANCH]
#
# Parameters:
# * REF: Git commit SHA in distribution-scripts (default: HEAD)
# * BRANCH: Branch name for CI branch in crystal (default: ci/update-distribution-scripts)
#
# Requirements:
# * packages: git gh sed
Expand All @@ -20,13 +24,13 @@ GIT_DS="git --git-dir=$DISTRIBUTION_SCRIPTS_WORK_DIR"

$GIT_DS fetch origin master

if [ -z "${1:-}"]; then
if [ "${1:-"HEAD"}" = "HEAD" ]; then
reference=$($GIT_DS rev-list origin/master | head -1)
else
reference=${1}
fi

branch="ci/update-distribution-scripts"
branch="${2:-"ci/update-distribution-scripts"}"

git switch -C "$branch" master

Expand All @@ -38,15 +42,19 @@ sed -i -E "/distribution-scripts-version:/{n;n;n;s/default: \".*\"/default: \"$r
git add .circleci/config.yml

message="Updates \`distribution-scripts\` dependency to https://github.com/crystal-lang/distribution-scripts/commit/$reference"
log=$($GIT_DS log $old_reference..$reference --format="%s" | sed "s/.*(/\* crystal-lang\/distribution-scripts/;s/.$//")
message="$message\n\nThis includes the following changes:\n\n$log"
log=$($GIT_DS log $old_reference..$reference --format="%s" | sed "s/.*(/crystal-lang\/distribution-scripts/;s/^/* /;s/.$//")
message=$(printf "$message\n\nThis includes the following changes:\n\n$log")

git commit -m "Update distribution-scripts" -m "$message"

git show

git push -u upstream "$branch"

# Confirm creating pull request
echo "Create pull request for branch $branch? [y/N]"
read -r REPLY

# Create pull request
gh pr create -R crystal-lang/crystal --fill --label "topic:infrastructure" --assignee "@me"
if [ "$REPLY" = "y" ]; then
gh pr create -R crystal-lang/crystal --fill --label "topic:infrastructure" --assignee "@me"
fi

0 comments on commit 64d7bff

Please sign in to comment.