Skip to content

Commit

Permalink
feat: Bump version workflow now also creates tags
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Aug 12, 2024
1 parent eeaf9ec commit 4f91ad8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/bump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
custom_components/solarman/
sparse-checkout: custom_components/solarman/
sparse-checkout-cone-mode: false
- name: Check for new commits
id: check_new_commits
run: |
git_log=$(git log --since=midnight -- custom_components/solarman/)
echo "new_commits=$([[ -n "$git_log" ]] && echo "true" || echo "false")" >> $GITHUB_OUTPUT
bump:
name: Do
name: Bump
runs-on: ubuntu-latest
needs: check_commits
if: needs.check_commits.outputs.new_commits == 'true' || github.event_name == 'workflow_dispatch'
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
custom_components/solarman/manifest.json
sparse-checkout: custom_components/solarman/manifest.json
sparse-checkout-cone-mode: false
- run: 'sed -i "s/.*version.*/ \"version\": \"$(date +''%y.%m.%d'')\"/" custom_components/solarman/manifest.json'
- run: |
version=$(date +"%y.%m.%d")
sed -i "s/.*version.*/ \"version\": \"$version\"/" custom_components/solarman/manifest.json
git config --global user.name "Continuous Integration"
git config --global user.email "[email protected]"
git commit -m "chore: bump version" custom_components/solarman/manifest.json
git push
git commit -m "chore: Bump version" custom_components/solarman/manifest.json
git tag -a "v$version" -m "Scheduled $([[ $version == *4 ]] || echo 'pre-')release"
git push --follow-tags

0 comments on commit 4f91ad8

Please sign in to comment.