From 45b24fb41b065a97e5255a2edf8a0cb1e7997ba2 Mon Sep 17 00:00:00 2001 From: "Jibon L. Costa" Date: Sat, 21 Dec 2024 23:03:09 +0100 Subject: [PATCH] try --- .github/workflows/release-please.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 5f0735e0..563c0bd4 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -29,16 +29,23 @@ jobs: version: 9 - name: Install dependencies run: pnpm install - - name: Bump version to prerelease - if: ${{ ! steps.release.outputs.release_created }} - run: npm version prerelease - - uses: stefanzweifel/git-auto-commit-action@v5 - if: ${{ ! steps.release.outputs.release_created }} - with: - commit_message: bump beta version - - name: Create beta zip + - name: Release as beta if: ${{ ! steps.release.outputs.release_created }} run: | + # update package version + git_hash=$(git rev-parse --short "$GITHUB_SHA") + NEXT_VERSION=$(echo $(node -p "require('./package.json').version") | awk -F. -v OFS=. '{$NF += 1 ; print}') + BETA_VERSION="${NEXT_VERSION}-${git_hash}" + echo "New beta version for NPM: ${BETA_VERSION}" + pnpm version ${BETA_VERSION} + + # push changes + git config --global user.name github-actions + git config --global user.email github-actions@github.com + git add . + git commit -m "bump beta version" + git push + # now create zip file pnpm run build echo ${BETA_VERSION} > dist/version.txt