Skip to content

Commit

Permalink
Fix release
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Sep 30, 2024
1 parent e7e2af9 commit 037c33f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release
on:
push:
tags:
- "v*.*.*"
- "*.*.*"

jobs:
release:
Expand Down
25 changes: 7 additions & 18 deletions .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,19 @@
# invoked by release workflow
# (via https://github.com/bazel-contrib/.github/blob/master/.github/workflows/release_ruleset.yaml)

#set -o errexit -o nounset -o pipefail
set -o errexit -o nounset -o pipefail

RULES_NAME="rules_gazebo"
TAG="${GITHUB_REF_NAME}"
PREFIX="${RULES_NAME}-${TAG:1}"
ARCHIVE="${RULES_NAME}-${TAG:1}.tar.gz"
TAG=${GITHUB_REF_NAME}

echo $RULES_NAME
echo $TAG
echo $PREFIX
echo $ARCHIVE

# embed version in MODULE.bazel
perl -pi -e "s/version = \"0\.0\.0\",/version = \"${TAG:1}\",/g" MODULE.bazel

stash_name=`git stash create`;
git archive --format=tar --prefix=${PREFIX}/ "${stash_name}" | gzip > $ARCHIVE

SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
# The prefix is chosen to match what GitHub generates for source archives
PREFIX="rules_gazebo-${TAG}"
ARCHIVE="rules_gazebo-$TAG.tar.gz"
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE

cat << EOF
Add to your \`MODULE.bazel\` file:
\`\`\`starlark
bazel_dep(name = "${RULES_NAME}", version = "${TAG:1}")
bazel_dep(name = "rules_gazebo", version = "${TAG}")
\`\`\`
EOF

0 comments on commit 037c33f

Please sign in to comment.