release.yml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. name: Release
  2. on:
  3. pull_request:
  4. branches:
  5. - release/current
  6. - release/*.*.*
  7. types: [closed]
  8. jobs:
  9. create-github-release:
  10. runs-on: ubuntu-latest
  11. if: github.event.pull_request.merged == true
  12. outputs:
  13. RELEASED_VERSION: ${{ steps.package-json.outputs.packageVersion }}
  14. steps:
  15. - uses: actions/checkout@v4
  16. with:
  17. ref: ${{ github.event.pull_request.base.ref }}
  18. - uses: pnpm/action-setup@v4
  19. - uses: actions/setup-node@v4
  20. with:
  21. node-version: '22'
  22. cache: 'pnpm'
  23. - name: Install dependencies
  24. run: |
  25. pnpm add turbo --global
  26. pnpm install --frozen-lockfile
  27. - name: Bump versions
  28. run: |
  29. turbo run version:patch --filter=@growi/app
  30. sh ./apps/app/bin/github-actions/update-readme.sh
  31. - name: Retrieve information from package.json
  32. uses: myrotvorets/info-from-package-json-action@v2.0.2
  33. id: package-json
  34. - name: Update Changelog
  35. uses: stefanzweifel/changelog-updater-action@v1
  36. with:
  37. latest-version: v${{ steps.package-json.outputs.packageVersion }}
  38. release-notes: ${{ github.event.pull_request.body }}
  39. - name: Update README.md for docker image
  40. working-directory: ./apps/app
  41. run: |
  42. sh ./bin/github-actions/update-readme.sh
  43. env:
  44. RELEASED_VERSION: ${{ steps.package-json.outputs.packageVersion }}
  45. - name: Commit, Tag and Push
  46. uses: stefanzweifel/git-auto-commit-action@v5
  47. with:
  48. branch: ${{ github.event.pull_request.base.ref }}
  49. commit_message: Release v${{ steps.package-json.outputs.packageVersion }}
  50. tagging_message: v${{ steps.package-json.outputs.packageVersion }}
  51. - uses: softprops/action-gh-release@v2
  52. with:
  53. body: ${{ github.event.pull_request.body }}
  54. tag_name: v${{ steps.package-json.outputs.packageVersion }}
  55. target_commitish: ${{ github.head_ref }}
  56. - name: Delete drafts
  57. uses: hugo19941994/delete-draft-releases@v1.0.1
  58. env:
  59. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  60. determine-tags:
  61. needs: create-github-release
  62. runs-on: ubuntu-latest
  63. outputs:
  64. TAGS: ${{ steps.meta.outputs.tags }}
  65. steps:
  66. - uses: actions/checkout@v4
  67. - name: Retrieve information from package.json
  68. uses: myrotvorets/info-from-package-json-action@v2.0.2
  69. id: package-json
  70. - name: Docker meta for docker.io
  71. uses: docker/metadata-action@v5
  72. id: meta
  73. with:
  74. images: docker.io/weseek/growi
  75. sep-tags: ','
  76. tags: |
  77. type=raw,value=latest
  78. type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}
  79. type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}.{{minor}}
  80. type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}.{{minor}}.{{patch}}
  81. build-app-image:
  82. needs: create-github-release
  83. uses: weseek/growi/.github/workflows/reusable-app-build-image.yml@master
  84. with:
  85. source-version: refs/tags/v${{ needs.create-github-release.outputs.RELEASED_VERSION }}
  86. image-name: weseek/growi
  87. tag-temporary: latest
  88. secrets:
  89. AWS_ROLE_TO_ASSUME_FOR_OIDC: ${{ secrets.AWS_ROLE_TO_ASSUME_FOR_OIDC }}
  90. publish-app-image:
  91. needs: [determine-tags, build-app-image]
  92. uses: weseek/growi/.github/workflows/reusable-app-create-manifests.yml@master
  93. with:
  94. tags: ${{ needs.determine-tags.outputs.TAGS }}
  95. registry: docker.io
  96. image-name: weseek/growi
  97. tag-temporary: latest
  98. secrets:
  99. DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
  100. post-publish:
  101. needs: [create-github-release, publish-app-image]
  102. runs-on: ubuntu-latest
  103. steps:
  104. - uses: actions/checkout@v4
  105. with:
  106. ref: v${{ needs.create-github-release.outputs.RELEASED_VERSION }}
  107. - name: Update Docker Hub Description
  108. uses: peter-evans/dockerhub-description@v4
  109. with:
  110. username: wsmoogle
  111. password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
  112. repository: weseek/growi
  113. readme-filepath: ./apps/app/docker/README.md
  114. - name: Slack Notification
  115. uses: weseek/ghaction-release-slack-notification@master
  116. with:
  117. channel: '#release'
  118. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  119. created_tag: 'v${{ needs.create-github-release.outputs.RELEASED_VERSION }}'
  120. create-pr-for-next-rc:
  121. needs: [create-github-release, publish-app-image]
  122. runs-on: ubuntu-latest
  123. steps:
  124. - uses: actions/checkout@v4
  125. with:
  126. ref: v${{ needs.create-github-release.outputs.RELEASED_VERSION }}
  127. - uses: pnpm/action-setup@v4
  128. - uses: actions/setup-node@v4
  129. with:
  130. node-version: '22'
  131. cache: 'pnpm'
  132. - name: Install dependencies
  133. run: |
  134. pnpm add turbo --global
  135. pnpm install --frozen-lockfile
  136. - name: Bump versions for next RC
  137. run: |
  138. turbo run version:prepatch --filter=@growi/app
  139. turbo run version:prepatch --filter=@growi/slackbot-proxy
  140. - name: Retrieve information from package.json
  141. uses: myrotvorets/info-from-package-json-action@v2.0.2
  142. id: package-json
  143. - name: Commit
  144. uses: github-actions-x/commit@v2.9
  145. with:
  146. github-token: ${{ secrets.GITHUB_TOKEN }}
  147. push-branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
  148. commit-message: 'Bump version'
  149. name: GitHub Action
  150. - name: Create PR
  151. uses: repo-sync/pull-request@v2
  152. with:
  153. source_branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
  154. destination_branch: ${{ github.head_ref }}
  155. pr_title: Prepare v${{ steps.package-json.outputs.packageVersion }}
  156. pr_label: flag/exclude-from-changelog,type/prepare-next-version
  157. pr_body: "[skip ci] An automated PR generated by create-pr-for-next-rc"
  158. github_token: ${{ secrets.GITHUB_TOKEN }}