Skip to content

Commit

Permalink
[#525] Define create_release_pr workflow to automate Release PR creating
Browse files Browse the repository at this point in the history
  • Loading branch information
luongvo committed Nov 6, 2023
1 parent ebf81b4 commit 758a2fe
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .cicdtemplate/.github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
perl -i -pe 's/ANDROID_VERSION_NAME =(.*)$/ANDROID_VERSION_NAME = "${{ github.event.inputs.newVersion }}"/g' buildSrc/src/main/java/Versions.kt
- name: Create pull request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5
with:
assignees: ${{ secrets.GITHUB_USER }}
token: ${{ secrets.WIKI_ACTION_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
perl -i -pe 's/ANDROID_VERSION_NAME =(.*)$/ANDROID_VERSION_NAME = "${{ github.event.inputs.newVersion }}"/g' sample-compose/buildSrc/src/main/java/Versions.kt
- name: Create pull request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5
with:
assignees: ${{ secrets.GITHUB_USER }}
token: ${{ secrets.WIKI_ACTION_TOKEN }}
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/changelog-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"categories": [
{
"title": "## ✨ Features",
"labels": [
"type : feature"
]
},
{
"title": "## 🐛 Bug fixes",
"labels": [
"type : bug"
]
},
{
"title": "## 🧹 Chores",
"labels": [
"type : chore"
]
},
{
"title": "## Others",
"exclude_labels": [
"type : feature",
"type : bug",
"type : chore",
"type : release"
]
}
],
"max_pull_requests": 200
}
55 changes: 55 additions & 0 deletions .github/workflows/create_release_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Create the Release pull request

on:
workflow_dispatch:
# testing
push:
branches:
- feature/525-create-release-pr-workflow

jobs:
bump_version:
name: Bump version
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Read the current version
id: version
uses: christian-draeger/[email protected]
with:
path: 'version.properties'
properties: 'templateScriptVersion'

- name: Find HEAD commit
id: head
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT

- name: Build changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
configuration: ".github/workflows/changelog-config.json"
# Listing PRs from the last tag to the HEAD commit
toTag: ${{ steps.head.outputs.sha }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Create the Release pull request
uses: peter-evans/create-pull-request@v5
with:
assignees: ${{ secrets.GITHUB_USER }}
token: ${{ secrets.WIKI_ACTION_TOKEN }}
committer: Nimble Bot <[email protected]>
branch: release/${{ steps.version.outputs.templateScriptVersion }}
base: main
delete-branch: true
title: 'Release - ${{ steps.version.outputs.templateScriptVersion }}'
labels: |
type : release
body: |
https://github.com/nimblehq/android-templates/milestone/TODO
${{ steps.changelog.outputs.changelog }}

0 comments on commit 758a2fe

Please sign in to comment.