From 4f91ad80b7d0f3a16c36dae2ed22e77c96c483cc Mon Sep 17 00:00:00 2001 From: David Rapan Date: Mon, 12 Aug 2024 02:31:26 +0200 Subject: [PATCH] feat: Bump version workflow now also creates tags --- .github/workflows/bump.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bump.yaml b/.github/workflows/bump.yaml index 27cd4d2..2450835 100644 --- a/.github/workflows/bump.yaml +++ b/.github/workflows/bump.yaml @@ -14,8 +14,7 @@ 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 @@ -23,7 +22,7 @@ jobs: 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' @@ -31,12 +30,13 @@ jobs: 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 "david@rapan.cz" - 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