Skip to content

Commit

Permalink
Add scripts/update-shards.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Feb 12, 2025
1 parent c145ba9 commit 5e3217a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/update-shards.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env sh

# Update shards release.
#
# Usage:
#
# scripts/update-shards.sh [<version>]
#
# This helper script pulls the latest Shards release from GitHub and updates all
# references to the shards release in this repository.
#
# See Crystal release checklist: https://github.com/crystal-lang/distribution-scripts/blob/master/processes/shards-release.md#post-release

set -eux

SHARDS_VERSION=${1:-}
if [ -z "$SHARDS_VERSION" ]; then
# fetch latest release from GitHub
SHARDS_VERSION=$(gh release view --repo crystal-lang/shards --json tagName --jq .tagName | cut -c 2-)
fi

# Update shards ref in mingw64 and win-msvc build actions
sed -i "/repository: crystal-lang\/shards/{n;s/ref: .*/ref: ${shards_version}/}" .github/workflows/mingw-w64.yml .github/workflows/win_build_portable.yml

0 comments on commit 5e3217a

Please sign in to comment.