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..ff3b3d0ac --- /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: + create_release_pr: + name: Create the Release pull request + 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 }} diff --git a/.github/workflows/review_pull_request.yml b/.github/workflows/review_pull_request.yml deleted file mode 100644 index a2385815d..000000000 --- a/.github/workflows/review_pull_request.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Review pull request - -on: - pull_request: - types: [ opened, edited, reopened, synchronize ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - review_pull_request: - name: Review pull request - runs-on: ubuntu-latest - timeout-minutes: 30 - environment: template-compose - steps: - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Cache Gradle - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- - - # template-compose - - - name: Run Detekt on template-compose - working-directory: ./template-compose - run: ./gradlew detekt - - - name: Run Android Lint on template-compose - working-directory: ./template-compose - run: ./gradlew lint - - - name: Run unit tests with Kover on template-compose - working-directory: ./template-compose - run: ./gradlew koverXmlReport - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - - - name: Cache gems - uses: actions/cache@v2 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - - name: Install Bundle and check environment versions - run: | - echo 'Install Bundle' - bundle config path vendor/bundle - bundle install - echo 'Check environment setup versions' - ruby --version - gem --version - bundler --version - - - name: Run Danger - env: - DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bundle exec danger diff --git a/.github/workflows/run_detekt_and_unit_tests.yml b/.github/workflows/run_detekt_and_unit_tests.yml deleted file mode 100644 index a7bc38230..000000000 --- a/.github/workflows/run_detekt_and_unit_tests.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Run Detekt and unit tests - -on: push - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - run_detekt_and_unit_tests: - name: Run Detekt and unit tests - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Cache Gradle - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- - - # template-compose - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - - - name: Run Detekt on template-compose - working-directory: ./template-compose - run: ./gradlew detekt - - - name: Archive Detekt reports on template-compose - uses: actions/upload-artifact@v3 - with: - name: DetektReportsTemplateCompose - path: template-compose/build/reports/detekt/ - - - name: Run unit tests with Kover on template-compose - working-directory: ./template-compose - run: ./gradlew koverHtmlReport - - - name: Archive code coverage reports on template-compose - uses: actions/upload-artifact@v3 - with: - name: CodeCoverageReportsTemplateCompose - path: template-compose/app/build/reports/kover/ - - # sample-compose - - - name: Run Detekt on sample-compose - working-directory: ./sample-compose - run: ./gradlew detekt - - - name: Archive Detekt reports on sample-compose - uses: actions/upload-artifact@v3 - with: - name: DetektReportsTemplateCompose - path: sample-compose/build/reports/detekt/ - - - name: Run unit tests with Kover on sample-compose - working-directory: ./sample-compose - run: ./gradlew koverHtmlReport - - - name: Archive code coverage reports on sample-compose - uses: actions/upload-artifact@v3 - with: - name: CodeCoverageReportsTemplateCompose - path: sample-compose/app/build/reports/kover/ diff --git a/.github/workflows/verify_newproject_script.yml b/.github/workflows/verify_newproject_script.yml deleted file mode 100644 index 2d44ab60d..000000000 --- a/.github/workflows/verify_newproject_script.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Verify newproject script - -on: - pull_request: - types: [ opened, reopened, synchronize ] - branches: [ develop ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - verify_newproject_script: - name: Verify newproject script - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Cache Gradle - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- - - - name: Install Kscript - run: | - curl -s "https://get.sdkman.io" | bash - source "$HOME/.sdkman/bin/sdkman-init.sh" - source version.properties - sdk install kotlin $kotlinVersion - sdk install kscript $kscriptVersion - echo $PATH >> $GITHUB_PATH - - - name: Verify generating new project from template-compose - working-directory: scripts - run: kscript new_project.kts package-name=co.mycomposeproject.example app-name="My Compose Project" template=compose -