Bump JetHome subversion within action #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: JH Reset jethome stable version on version bump | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- stable.json | |
jobs: | |
resetversion: | |
name: Reset subversion | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: true | |
ref: main | |
- name: Zero minor version | |
uses: jethome-iot/actions/armbian-jethome-version@master | |
id: fixversion | |
with: | |
file: 'stable-jethome.json' | |
type: 'minor' | |
do: 'zero' | |
- name: Check version | |
id: checkversion | |
run: | | |
CURRENT_VERSION=$(jq -r '.version' stable.json) | |
CURRENT_HIGH_VERSION=$(echo "$CURRENT_VERSION" | cut -d'.' -f1 ) | |
PREVIOUS_VERSION=$(git show HEAD~1:stable.json | jq -r '.version') | |
PREVIOUS_HIGH_VERSION=$(echo "$PREVIOUS_VERSION" | cut -d'.' -f1) | |
if [ "$CURRENT_HIGH_VERSION" != "$PREVIOUS_HIGH_VERSION" ]; then | |
echo "changed=true" >> $GITHUB_OUTPUT | |
else | |
echo "changed=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Inc major version | |
if: steps.checkversion.outputs.changed == 'true' | |
uses: jethome-iot/actions/armbian-jethome-version@master | |
id: zeroversion | |
with: | |
file: 'stable-jethome.json' | |
type: 'major' | |
do: 'zero' | |
- name: Inc major version | |
if: steps.checkversion.outputs.changed != 'true' | |
uses: jethome-iot/actions/armbian-jethome-version@master | |
id: incversion | |
with: | |
file: 'stable-jethome.json' | |
type: 'major' | |
do: 'inc' | |
- shell: bash | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "GitHub Actions" | |
git add stable-jethome.json | |
git commit -am "Clean jethome-version" | |
git pull | |
git push | |