| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- name: Release
- on:
- pull_request:
- branches:
- - release/current
- - release/*.*.*
- types: [closed]
- jobs:
- create-github-release:
- runs-on: ubuntu-latest
- if: github.event.pull_request.merged == true
- outputs:
- RELEASED_VERSION: ${{ steps.package-json.outputs.packageVersion }}
- steps:
- - uses: actions/checkout@v4
- with:
- ref: ${{ github.event.pull_request.base.ref }}
- - uses: pnpm/action-setup@v4
- - uses: actions/setup-node@v4
- with:
- node-version: '20'
- cache: 'pnpm'
- - name: Install dependencies
- run: |
- pnpm add turbo --global
- pnpm install --frozen-lockfile
- - name: Bump versions
- run: |
- turbo run version:patch --filter=@growi/app
- sh ./apps/app/bin/github-actions/update-readme.sh
- - name: Retrieve information from package.json
- uses: myrotvorets/info-from-package-json-action@v2.0.2
- id: package-json
- - name: Update Changelog
- uses: stefanzweifel/changelog-updater-action@v1
- with:
- latest-version: v${{ steps.package-json.outputs.packageVersion }}
- release-notes: ${{ github.event.pull_request.body }}
- - name: Update README.md for docker image
- working-directory: ./apps/app
- run: |
- sh ./bin/github-actions/update-readme.sh
- env:
- RELEASED_VERSION: ${{ steps.package-json.outputs.packageVersion }}
- - name: Commit, Tag and Push
- uses: stefanzweifel/git-auto-commit-action@v5
- with:
- branch: ${{ github.event.pull_request.base.ref }}
- commit_message: Release v${{ steps.package-json.outputs.packageVersion }}
- tagging_message: v${{ steps.package-json.outputs.packageVersion }}
- - uses: softprops/action-gh-release@v2
- with:
- body: ${{ github.event.pull_request.body }}
- tag_name: v${{ steps.package-json.outputs.packageVersion }}
- target_commitish: ${{ github.head_ref }}
- - name: Delete drafts
- uses: hugo19941994/delete-draft-releases@v1.0.1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- determine-tags:
- needs: create-github-release
- runs-on: ubuntu-latest
- outputs:
- TAGS: ${{ steps.meta.outputs.tags }}
- steps:
- - uses: actions/checkout@v4
- - name: Retrieve information from package.json
- uses: myrotvorets/info-from-package-json-action@v2.0.2
- id: package-json
- - name: Docker meta for docker.io
- uses: docker/metadata-action@v5
- id: meta
- with:
- images: docker.io/growilabs/growi
- sep-tags: ','
- tags: |
- type=raw,value=latest
- type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}
- type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}.{{minor}}
- type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}.{{minor}}.{{patch}}
- build-app-image:
- needs: create-github-release
- uses: growilabs/growi/.github/workflows/reusable-app-build-image.yml@master
- with:
- source-version: refs/tags/v${{ needs.create-github-release.outputs.RELEASED_VERSION }}
- image-name: growilabs/growi
- tag-temporary: latest
- secrets:
- AWS_ROLE_TO_ASSUME_FOR_OIDC: ${{ secrets.AWS_ROLE_TO_ASSUME_FOR_OIDC }}
- publish-app-image:
- needs: [determine-tags, build-app-image]
- uses: growilabs/growi/.github/workflows/reusable-app-create-manifests.yml@master
- with:
- tags: ${{ needs.determine-tags.outputs.TAGS }}
- registry: docker.io
- image-name: 'growilabs/growi'
- docker-registry-username: 'growimoogle'
- tag-temporary: latest
- secrets:
- DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD_GROWIMOOGLE }}
- post-publish:
- needs: [create-github-release, publish-app-image]
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- ref: v${{ needs.create-github-release.outputs.RELEASED_VERSION }}
- - name: Update Docker Hub Description
- uses: peter-evans/dockerhub-description@v3
- with:
- username: growimoogle
- password: ${{ secrets.DOCKER_REGISTRY_PASSWORD_GROWIMOOGLE }}
- repository: growilabs/growi
- readme-filepath: ./apps/app/docker/README.md
- - name: Slack Notification
- uses: weseek/ghaction-release-slack-notification@master
- with:
- channel: '#release'
- url: ${{ secrets.SLACK_WEBHOOK_URL }}
- created_tag: 'v${{ needs.create-github-release.outputs.RELEASED_VERSION }}'
- create-pr-for-next-rc:
- needs: [create-github-release, publish-app-image]
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- ref: v${{ needs.create-github-release.outputs.RELEASED_VERSION }}
- - uses: pnpm/action-setup@v4
- - uses: actions/setup-node@v4
- with:
- node-version: '20'
- cache: 'pnpm'
- - name: Install dependencies
- run: |
- pnpm add turbo --global
- pnpm install --frozen-lockfile
- - name: Bump versions for next RC
- run: |
- turbo run version:prepatch --filter=@growi/app
- turbo run version:prepatch --filter=@growi/slackbot-proxy
- - name: Retrieve information from package.json
- uses: myrotvorets/info-from-package-json-action@v2.0.2
- id: package-json
- - name: Commit
- uses: github-actions-x/commit@v2.9
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- push-branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
- commit-message: 'Bump version'
- name: GitHub Action
- - name: Create PR
- uses: repo-sync/pull-request@v2
- with:
- source_branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
- destination_branch: ${{ github.head_ref }}
- pr_title: Prepare v${{ steps.package-json.outputs.packageVersion }}
- pr_label: flag/exclude-from-changelog,type/prepare-next-version
- pr_body: "[skip ci] An automated PR generated by create-pr-for-next-rc"
- github_token: ${{ secrets.GITHUB_TOKEN }}
|