From 887043e10061d6df51aedacbe8ffaa03d32d64f3 Mon Sep 17 00:00:00 2001 From: Aaron Pham Date: Tue, 9 Jul 2024 22:15:15 -0400 Subject: [PATCH] infra: update release scripts to run locally Signed-off-by: Aaron Pham --- .github/actions/release.sh | 20 +++----------------- .github/workflows/create-releases.yml | 4 ++-- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/actions/release.sh b/.github/actions/release.sh index 6feb31e1..346e2e6b 100755 --- a/.github/actions/release.sh +++ b/.github/actions/release.sh @@ -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 @@ -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}" @@ -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}" diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml index 6e7a0e87..382a7b75 100644 --- a/.github/workflows/create-releases.yml +++ b/.github/workflows/create-releases.yml @@ -7,9 +7,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # ratchet:actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # ratchet:actions/setup-python@v5 with: python-version-file: .python-version-default - name: Build