Auto-update re2c Version #55
This file contains hidden or 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: Auto-update re2c Version | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 10 * * 1' | |
| # pull_request_target: | |
| # branches: [ main ] | |
| jobs: | |
| update-dep: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check and update re2c version | |
| id: check-re2c | |
| run: | | |
| old_version="$(grep -Po '(?<=RE2C_VERSION )\d+(\.\d+)+' re2c_version.cmake)" | |
| echo "Old version: $old_version" | |
| echo "old_version=$old_version" >> $GITHUB_OUTPUT | |
| new_version_raw=$(git -c 'versionsort.suffix=-' \ | |
| ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/skvadrik/re2c/ '*.*'\ | |
| | tail --lines=1\ | |
| | cut --delimiter='/' --fields=3) | |
| echo "New version (raw): $new_version_raw" | |
| new_version=$(git -c 'versionsort.suffix=-' \ | |
| ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/skvadrik/re2c/ '*.*'\ | |
| | tail --lines=1\ | |
| | cut --delimiter='/' --fields=3\ | |
| | grep -Po '\d+(\.\d+)+') | |
| echo "New version: $new_version" | |
| echo "new_version=$new_version" >> $GITHUB_OUTPUT | |
| if [ "$old_version" != "$new_version" ] && [ "$new_version" = "$new_version_raw" ]; then | |
| echo "set(RE2C_VERSION $new_version)" > re2c_version.cmake | |
| echo "re2c version updated" | |
| else | |
| echo "No change in re2c version" | |
| fi | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: Update re2c version to ${{ steps.check-re2c.outputs.new_version }} | |
| title: Update re2c version (${{ steps.check-re2c.outputs.new_version }}) | |
| body: | | |
| - Update re2c version to ${{ steps.check-re2c.outputs.new_version }} | |
| Auto-generated by ${{ github.server_url }}/${{ github.repository }}/runs/${{ github.job }}?check_suite_focus=true | |
| author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
| branch: re2c-version-update/${{ steps.check-re2c.outputs.new_version }} |