diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index 4940d7a..44f9cd1 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -43,7 +43,11 @@ jobs: git init git pull ${fullrepo} npm install @angular/cli - npm run lint + npm run lint + - name: Update version + run: | + chmod +x update-version.sh + ./update-version.sh patch - name: Build and push uses: docker/build-push-action@v6 with: diff --git a/update-version.sh b/update-version.sh new file mode 100644 index 0000000..a2a1115 --- /dev/null +++ b/update-version.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +# Get current version +current_version=$(jq -r '.version' package.json) +echo "Current version: $current_version" + +# Determine new version (example: increment patch) +IFS='.' read -r major minor patch <<< "$current_version" +new_patch=$((patch + 1)) +new_version="$major.$minor.$new_patch" +echo "New version: $new_version" + +# Update package.json +jq ".version = \"$new_version\"" package.json > temp.json && mv temp.json package.json + +# Optional: Commit and tag +git config --global user.email "pipeline@example.com" +git config --global user.name "Pipeline Bot" +git add package.json +git commit -m "Bump version to $new_version" +git tag -a "v$new_version" -m "Release version $new_version" +git push origin HEAD --tags \ No newline at end of file