Update version
This commit is contained in:
parent
ad86ff347e
commit
ec15a90789
1 changed files with 9 additions and 7 deletions
|
@ -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
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
|
|
Loading…
Reference in a new issue