release.yml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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: '20'
  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/growilabs/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: growilabs/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: growilabs/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: growilabs/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: 'growilabs/growi'
  97. docker-registry-username: 'growimoogle'
  98. tag-temporary: latest
  99. secrets:
  100. DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD_GROWIMOOGLE }}
  101. post-publish:
  102. needs: [create-github-release, publish-app-image]
  103. runs-on: ubuntu-latest
  104. steps:
  105. - uses: actions/checkout@v4
  106. with:
  107. ref: v${{ needs.create-github-release.outputs.RELEASED_VERSION }}
  108. - name: Update Docker Hub Description
  109. uses: peter-evans/dockerhub-description@v3
  110. with:
  111. username: growimoogle
  112. password: ${{ secrets.DOCKER_REGISTRY_PASSWORD_GROWIMOOGLE }}
  113. repository: growilabs/growi
  114. readme-filepath: ./apps/app/docker/README.md
  115. - name: Slack Notification
  116. uses: weseek/ghaction-release-slack-notification@master
  117. with:
  118. channel: '#release'
  119. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  120. created_tag: 'v${{ needs.create-github-release.outputs.RELEASED_VERSION }}'
  121. create-pr-for-next-rc:
  122. needs: [create-github-release, publish-app-image]
  123. runs-on: ubuntu-latest
  124. steps:
  125. - uses: actions/checkout@v4
  126. with:
  127. ref: v${{ needs.create-github-release.outputs.RELEASED_VERSION }}
  128. - uses: pnpm/action-setup@v4
  129. - uses: actions/setup-node@v4
  130. with:
  131. node-version: '20'
  132. cache: 'pnpm'
  133. - name: Install dependencies
  134. run: |
  135. pnpm add turbo --global
  136. pnpm install --frozen-lockfile
  137. - name: Bump versions for next RC
  138. run: |
  139. turbo run version:prepatch --filter=@growi/app
  140. turbo run version:prepatch --filter=@growi/slackbot-proxy
  141. - name: Retrieve information from package.json
  142. uses: myrotvorets/info-from-package-json-action@v2.0.2
  143. id: package-json
  144. - name: Commit
  145. uses: github-actions-x/commit@v2.9
  146. with:
  147. github-token: ${{ secrets.GITHUB_TOKEN }}
  148. push-branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
  149. commit-message: 'Bump version'
  150. name: GitHub Action
  151. - name: Create PR
  152. uses: repo-sync/pull-request@v2
  153. with:
  154. source_branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
  155. destination_branch: ${{ github.head_ref }}
  156. pr_title: Prepare v${{ steps.package-json.outputs.packageVersion }}
  157. pr_label: flag/exclude-from-changelog,type/prepare-next-version
  158. pr_body: "[skip ci] An automated PR generated by create-pr-for-next-rc"
  159. github_token: ${{ secrets.GITHUB_TOKEN }}