diff --git a/.cicdtemplate/.github/workflows/bump_version.yml b/.cicdtemplate/.github/workflows/bump_version.yml index 619374e55..170f6f340 100644 --- a/.cicdtemplate/.github/workflows/bump_version.yml +++ b/.cicdtemplate/.github/workflows/bump_version.yml @@ -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 }} diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml index 5c9ba0c12..50b67e370 100644 --- a/.github/workflows/bump_version.yml +++ b/.github/workflows/bump_version.yml @@ -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 }} diff --git a/.github/workflows/changelog-config.json b/.github/workflows/changelog-config.json new file mode 100644 index 000000000..aabe4d5f7 --- /dev/null +++ b/.github/workflows/changelog-config.json @@ -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 +} diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml new file mode 100644 index 000000000..096423cd7 --- /dev/null +++ b/.github/workflows/create_release_pr.yml @@ -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/read-properties@1.1.1 + 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 + 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 }}