-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
!/bin/bash | ||
# Usage: | ||
# | ||
# ./create_release.sh <tag> | ||
# | ||
# This script creates a directory for a module registry. The output is a | ||
# directory named <tag>, containing the MODULE.bazel file and a source.json file | ||
# as required for bazel registries. This directory can then be copied to the | ||
# modules directory of a bazel registry. The registries' metadata.json still | ||
# needs to be modified manually to make the tagged version available. | ||
|
||
TAG="$1"; | ||
|
||
RELEASE_DIR=$TAG; | ||
|
||
ARTIFACT=$(printf "$TAG.zip"); | ||
|
||
ARTIFACT_URL=$( | ||
printf 'https://github.com/eomii/rules_ll/archive/refs/tags/%s.zip' $TAG | ||
); | ||
|
||
STRIP_PREFIX=$(printf "rules_ll-%s" $TAG); | ||
|
||
mkdir $RELEASE_DIR; | ||
|
||
wget $ARTIFACT_URL; | ||
|
||
unzip -p $ARTIFACT $STRIP_PREFIX/MODULE.bazel > $RELEASE_DIR/MODULE.bazel; | ||
|
||
SHA256=$(cat $ARTIFACT | openssl sha256 -binary | openssl base64 -A); | ||
|
||
printf '{ | ||
"integrity": "sha256-%s", | ||
"strip_prefix": "%s", | ||
"url": "%s" | ||
} | ||
' $SHA256 $STRIP_PREFIX $ARTIFACT_URL > $RELEASE_DIR/source.json; | ||
|
||
rm $ARTIFACT; |