repo-bump-version.yaml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: '🆙 Auto bump_version'
  2. on:
  3. release:
  4. types:
  5. - published
  6. workflow_dispatch:
  7. inputs:
  8. TAG_BRANCH:
  9. required: true
  10. description: release-x.y.z
  11. NEXT_VERSION:
  12. required: true
  13. description: x.y.z
  14. jobs:
  15. auto_bump_version:
  16. runs-on: ubuntu-latest
  17. if: ${{ github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc') }}
  18. env:
  19. TAG_BRANCH: ${{ github.event.release.target_commitish }}
  20. steps:
  21. - name: Wait for deploy checks to finish
  22. uses: jitterbit/await-check-suites@292a541bb7618078395b2ce711a0d89cfb8a568a # v1
  23. with:
  24. ref: ${{ env.TAG_BRANCH }}
  25. intervalSeconds: 60
  26. timeoutSeconds: 3600
  27. - name: Setup YQ
  28. uses: chrisdickinson/setup-yq@latest
  29. with:
  30. yq-version: v4.9.8
  31. - name: Checkout Repository
  32. uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
  33. with:
  34. ref: ${{ env.TAG_BRANCH }}
  35. - name: Setup EnvVars
  36. run: |-
  37. CURRENT_VERSION=$(yq e '.version' build.yaml)
  38. CURRENT_MAJOR_MINOR=${CURRENT_VERSION%.*}
  39. CURRENT_PATCH=${CURRENT_VERSION##*.}
  40. echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
  41. echo "CURRENT_MAJOR_MINOR=${CURRENT_MAJOR_MINOR}" >> $GITHUB_ENV
  42. echo "CURRENT_PATCH=${CURRENT_PATCH}" >> $GITHUB_ENV
  43. echo "NEXT_VERSION=${CURRENT_MAJOR_MINOR}.$(($CURRENT_PATCH + 1))" >> $GITHUB_ENV
  44. - name: Run bump_version
  45. run: ./bump_version ${{ env.NEXT_VERSION }}
  46. - name: Commit Changes
  47. run: |-
  48. git config user.name "jellyfin-bot"
  49. git config user.email "team@jellyfin.org"
  50. git checkout ${{ env.TAG_BRANCH }}
  51. git commit -am "Bump version to ${{ env.NEXT_VERSION }}"
  52. git push origin ${{ env.TAG_BRANCH }}
  53. manual_bump_version:
  54. runs-on: ubuntu-latest
  55. if: ${{ github.event_name == 'workflow_dispatch' }}
  56. env:
  57. TAG_BRANCH: ${{ github.event.inputs.TAG_BRANCH }}
  58. NEXT_VERSION: ${{ github.event.inputs.NEXT_VERSION }}
  59. steps:
  60. - name: Checkout Repository
  61. uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
  62. with:
  63. ref: ${{ env.TAG_BRANCH }}
  64. - name: Run bump_version
  65. run: ./bump_version ${{ env.NEXT_VERSION }}
  66. - name: Commit Changes
  67. run: |-
  68. git config user.name "jellyfin-bot"
  69. git config user.email "team@jellyfin.org"
  70. git checkout ${{ env.TAG_BRANCH }}
  71. git commit -am "Bump version to ${{ env.NEXT_VERSION }}"
  72. git push origin ${{ env.TAG_BRANCH }}