From 02a78e8468c396d1d730b290bc17c136742d0543 Mon Sep 17 00:00:00 2001 From: VampireChicken12 Date: Tue, 29 Aug 2023 05:56:03 -0400 Subject: [PATCH] fix(maybe??): idk --- .github/workflows/release.yml | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 562ab930..ec69b309 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,23 +31,15 @@ jobs: GH_TOKEN: ${{secrets.GITHUB_TOKEN}} run: npx semantic-release - name: Update package.json Version - env: - GH_TOKEN: ${{secrets.GITHUB_TOKEN}} run: | - # Extract the new version from the Semantic Release output - NEW_VERSION=$(npx semantic-release --dry-run | grep "New version:" | awk '{print $3}') - - # Update package.json with the new version - node -e "const fs = require('fs'); const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')); packageJson.version = '$NEW_VERSION'; fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2));" + # Install Semantic Release and extract the new version + npx semantic-release --dry-run | grep "New version:" | awk '{print $3}' > new_version.txt - # Verify that package.json has been updated - cat package.json + # Use npm version to update the package.json + npm version $(cat new_version.txt) -m "chore(release): %s" - # Configure Git with GitHub secrets - git config user.name "${{ secrets.GH_USERNAME }}" - git config user.email "${{ secrets.GH_EMAIL }}" - - # Commit the updated package.json - git commit -am "chore(release): Bump version to $NEW_VERSION" - git push + # Push the changes back to the repository + git push --follow-tags + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} working-directory: ${{github.workspace}}