Skip to content

Commit

Permalink
infra: update release scripts to run locally
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Pham <[email protected]>
  • Loading branch information
aarnphm committed Jul 10, 2024
1 parent 45cd105 commit 5c630ff
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions .github/actions/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ validate_release() {
fi
}

if ! [ "$GITHUB_ACTIONS" = true ]; then
echo "This script should only be run on GitHub Actions. Aborting."
exit 1
fi

# Check if release flag is provided
if [[ $1 == "--release" ]]; then
# Check if release argument is provided
Expand All @@ -45,17 +40,6 @@ else
exit 1
fi

release_package() {
local version="$1"
echo "Releasing version ${version}..."
git add CHANGELOG.md changelog.d
git commit -S -sm "infra: prepare for release ${version} [generated] [skip ci]"
git push origin main
echo "Releasing tag ${version}..." && git tag -a "v${version}" -sm "Release ${version} [generated by GitHub Actions]"
git push origin "v${version}"
echo "Finish releasing version ${version}"
}

# Get the current version and separate the alpha part if it exists
version="$(git describe --tags "$(git rev-list --tags --max-count=1)")"
VERSION="${version#v}"
Expand Down Expand Up @@ -124,4 +108,6 @@ else
fi

echo "Commit count: $(git rev-list --count HEAD)"
release_package "${RELEASE_VERSION}"
echo "Releasing tag ${RELEASE_VERSION}..." && git tag -a "v${RELEASE_VERSION}" -sm "Release ${RELEASE_VERSION} [generated by GitHub Actions]"
git push origin "v${RELEASE_VERSION}"
echo "Finish releasing RELEASE_VERSION ${RELEASE_VERSION}"

0 comments on commit 5c630ff

Please sign in to comment.