./update-version.sh patch
This commit is contained in:
parent
533412797f
commit
fdfd19bdd2
2 changed files with 29 additions and 1 deletions
|
@ -43,7 +43,11 @@ jobs:
|
||||||
git init
|
git init
|
||||||
git pull ${fullrepo}
|
git pull ${fullrepo}
|
||||||
npm install @angular/cli
|
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
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
|
|
24
update-version.sh
Normal file
24
update-version.sh
Normal file
|
@ -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
|
Loading…
Reference in a new issue