auto-bump_version.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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@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.6
  31. - name: Checkout Repository
  32. uses: actions/checkout@v2
  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. steps:
  59. - name: Setup YQ
  60. uses: chrisdickinson/setup-yq@latest
  61. with:
  62. yq-version: v4.9.6
  63. - name: Checkout Repository
  64. uses: actions/checkout@v2
  65. with:
  66. ref: ${{ env.TAG_BRANCH }}
  67. - name: Setup EnvVars
  68. run: |-
  69. CURRENT_VERSION=$(yq e '.version' build.yaml)
  70. CURRENT_MAJOR_MINOR=${CURRENT_VERSION%.*}
  71. CURRENT_PATCH=${CURRENT_VERSION##*.}
  72. echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
  73. echo "CURRENT_MAJOR_MINOR=${CURRENT_MAJOR_MINOR}" >> $GITHUB_ENV
  74. echo "CURRENT_PATCH=${CURRENT_PATCH}" >> $GITHUB_ENV
  75. echo "NEXT_VERSION=${{ github.event.inputs.NEXT_VERSION }}" >> $GITHUB_ENV
  76. - name: Run bump_version
  77. run: ./bump_version ${{ env.NEXT_VERSION }}
  78. - name: Commit Changes
  79. run: |-
  80. git config user.name "jellyfin-bot"
  81. git config user.email "team@jellyfin.org"
  82. git checkout ${{ env.TAG_BRANCH }}
  83. git commit -am "Bump version to ${{ env.NEXT_VERSION }}"
  84. git push origin ${{ env.TAG_BRANCH }}