Skip to content

Commit

Permalink
Merge pull request #811 from pitbull51067/Regions
Browse files Browse the repository at this point in the history
Workflow file to change version
  • Loading branch information
jadeandtea authored Jan 21, 2025
2 parents e1b80a8 + 645a8a0 commit 1bbc6b7
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/version-changer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Increment Version on Push

on:
push:
branches:
- master

jobs:
increment_version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Determine new version
id: update_version
run: |
current_version=$(<legup-update/bin/main/edu.rpi.legupupdate/VERSION)
IFS='.' read -r -a version_parts <<< "$current_version"
first_part="${version_parts[0]}"
second_part="${version_parts[1]}"
last_part="${version_parts[2]}"
if [[ $last_part -eq 9 ]]; then
new_last_part=0
if [[ $second_part -eq 9 ]]; then
new_second_part=0
new_first_part=$((first_part + 1))
else
new_second_part=$((second_part + 1))
new_first_part=$first_part
fi
else
new_last_part=$((last_part + 1))
new_second_part=$second_part
new_first_part=$first_part
fi
new_version="$new_first_part.$new_second_part.$new_last_part"
echo "New version: $new_version"
echo "::set-output name=version::$new_version"
- name: Update version.txt with new version
run: echo "${{ steps.update_version.outputs.version }}" > legup-update/bin/main/edu.rpi.legupupdate/VERSION

- name: Commit and push changes
run: |
git config --global user.email "pitbull51067@yahoo.com"
git config --global user.name "Pitbull51067"
git add -f legup-update/bin/main/edu.rpi.legupupdate/VERSION
git commit -m "Increment version number"
git push
2 changes: 1 addition & 1 deletion legup-update/bin/main/edu.rpi.legupupdate/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
6.0.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Legup>
<puzzle name="Fillapix">
<board width="3" height="3">
<cells>
<cell value="6" x="1" y="1"/>
<cell value="-1" x="0" y="0"/>
<cell value="-1" x="0" y="1"/>
<cell value="-1" x="0" y="2"/>
</cells>
</board>
</puzzle>
</Legup>

0 comments on commit 1bbc6b7

Please sign in to comment.