From ec15a90789f9e9ec724573ab4f9833309a024889 Mon Sep 17 00:00:00 2001 From: miwr Date: Tue, 8 Apr 2025 13:40:18 +0200 Subject: [PATCH] Update version --- .forgejo/workflows/deploy.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index b631c7a..8deef9e 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -49,17 +49,19 @@ jobs: echo "getting the username" - name: Update version run: | - # Perform actions that modify files in the repository - echo "Updated content" > my_file.txt + set -e + current_version=$(jq -r '.version' package.json) + echo "Current version: $current_version" + IFS='.' read -r major minor patch <<< "$current_version" + new_patch=$((patch + 1)) + new_version="$major.$minor.$new_patch" + echo "New version: $new_version" + jq ".version = \"$new_version\"" package.json > temp.json && mv temp.json package.json git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "GitHub Actions Bot" git add . git commit -m "Automated update by GitHub Actions" - git push origin HEAD:${{ github.ref_name }} - - name: Update version - run: | - chmod +x update-version.sh - ./update-version.sh patch + git push origin HEAD:${{ github.ref_name }} - name: Build and push uses: docker/build-push-action@v6 with: