Skip to content

Commit

Permalink
Merge pull request #1966 from Adyen/chore/release_process_changes
Browse files Browse the repository at this point in the history
Release process changes
  • Loading branch information
araratthehero authored Jan 21, 2025
2 parents b95ca25 + 9f5a77c commit 3350319
Show file tree
Hide file tree
Showing 35 changed files with 1,051 additions and 221 deletions.
1 change: 1 addition & 0 deletions .github/.release_notes_allowed_labels_list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Breaking changes,New,Fixed,Improved,Changed,Removed,Deprecated
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/ask_question.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pre-Submission Checklist
3. Verify that the question specifically relates to the Android SDK
Integration guide: https://docs.adyen.com/online-payments/build-your-integration/?platform=Android
Github docs: https://github.com/Adyen/adyen-android/tree/develop/docs
Github docs: https://github.com/Adyen/adyen-android/tree/main/docs
-->

## Description
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pre-Submission Checklist
3. Verify that the bug specifically relates to the Android SDK
Integration guide: https://docs.adyen.com/online-payments/build-your-integration/?platform=Android
Github docs: https://github.com/Adyen/adyen-android/tree/develop/docs
Github docs: https://github.com/Adyen/adyen-android/tree/main/docs
-->

## Description
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pre-Submission Checklist
3. Verify that the feature specifically relates to the Android SDK
Integration guide: https://docs.adyen.com/online-payments/build-your-integration/?platform=Android
Github docs: https://github.com/Adyen/adyen-android/tree/develop/docs
Github docs: https://github.com/Adyen/adyen-android/tree/main/docs
-->

## Description
Expand Down
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,14 @@
- [ ] Related issues are linked

COAND-XXX

## Release notes
[//]: # (Use the headers listed below to organize your release notes. Each section should begin with ### followed by a valid label)
[//]: # (Allowed labels: `Breaking changes`, `New`, `Fixed`, `Improved`, `Changed`, `Removed`, `Deprecated`)
[//]: # (Content will be grouped under a specific label until the next header #, ##, or ### is found)
[//]: # (### New)
[//]: # (List any new features or enhancements)
[//]: # (e.g. - Added functionality for user authentication)
[//]: # (### Fixed)
[//]: # (List fixes here)
[//]: # (e.g. - Fixed issue with incorrect data rendering)
89 changes: 89 additions & 0 deletions .github/release_notes_dependency_list.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
[included]
"androidx.activity:activity" = "[AndroidX Activity](https://developer.android.com/jetpack/androidx/releases/activity)"
"androidx.activity:activity-compose" = "[AndroidX Activity Compose](https://developer.android.com/jetpack/androidx/releases/activity)"
"androidx.annotation:annotation" = "[AndroidX Annotation](https://developer.android.com/jetpack/androidx/releases/annotation)"
"androidx.appcompat:appcompat" = "[AndroidX Appcompat](https://developer.android.com/jetpack/androidx/releases/appcompat)"
"androidx.autofill:autofill" = "[AndroidX Autofill](https://developer.android.com/jetpack/androidx/releases/autofill)"
"androidx.browser:browser" = "[AndroidX Browser](https://developer.android.com/jetpack/androidx/releases/browser)"
"androidx.compose.compiler:compiler" = "[AndroidX Compose Compiler](https://developer.android.com/jetpack/androidx/releases/compose-compiler)"
"androidx.compose:compose-bom" = "[AndroidX Compose BoM](https://developer.android.com/develop/ui/compose/bom/bom-mapping)"
"androidx.constraintlayout:constraintlayout" = "[AndroidX ConstraintLayout](https://developer.android.com/jetpack/androidx/releases/constraintlayout)"
"androidx.fragment:fragment-ktx" = "[AndroidX Fragment](https://developer.android.com/jetpack/androidx/releases/fragment)"
"androidx.lifecycle:lifecycle-runtime-ktx" = "[AndroidX Lifecycle Runtime](https://developer.android.com/jetpack/androidx/releases/lifecycle)"
"androidx.lifecycle:lifecycle-viewmodel-compose" = "[AndroidX Lifecycle ViewModel Compose](https://developer.android.com/jetpack/androidx/releases/lifecycle)"
"androidx.lifecycle:lifecycle-viewmodel-ktx" = "[AndroidX Lifecycle ViewModel](https://developer.android.com/jetpack/androidx/releases/lifecycle)"
"androidx.preference:preference-ktx" = "[AndroidX Preference](https://developer.android.com/jetpack/androidx/releases/preference)"
"androidx.recyclerview:recyclerview" = "[AndroidX RecyclerView](https://developer.android.com/jetpack/androidx/releases/recyclerview)"
"app.cash.paykit:core" = "[CashApp Pay](https://github.com/cashapp/cash-app-pay-android-sdk/releases)"
"ch.twint.payment.sdk:android-sdk" = "Twint"
"com.adyen.threeds:adyen-3ds2" = "[Adyen 3DS2](https://github.com/Adyen/adyen-3ds2-android/releases)"
"com.android.library" = "[Android Gradle Plugin](https://developer.android.com/build/releases/gradle-plugin)"
"com.google.android.gms:play-services-wallet" = "[Play Services Wallet](https://developers.google.com/pay/api/android/support/release-notes)"
"com.google.android.material:material" = "[Material](https://github.com/material-components/material-components-android/releases)"
"com.squareup.okhttp3:okhttp" = "[OkHttp](https://square.github.io/okhttp/changelogs/changelog/)"
"com.tencent.mm.opensdk:wechat-sdk-android-without-mta" = "[WeChat](https://developers.weixin.qq.com/doc/oplatform/en/Mobile_App/Access_Guide/Android.html)"
"kotlin" = "[Kotlin](https://github.com/JetBrains/kotlin/releases)"
"org.jetbrains.kotlinx:kotlinx-coroutines-android" = "[Kotlin Coroutines Android](https://github.com/Kotlin/kotlinx.coroutines/releases)"
"org.jetbrains.kotlinx:kotlinx-coroutines-core" = "[Kotlin Coroutines](https://github.com/Kotlin/kotlinx.coroutines/releases)"

[excluded]
# We only need the package name, but since toml files are key value base we set an empty value.
"androidx.arch.core:core-testing" = ""
"androidx.compose.material3:material3" = ""
"androidx.compose.ui:ui" = ""
"androidx.compose.ui:ui-graphics" = ""
"androidx.compose.ui:ui-test-manifest" = ""
"androidx.compose.ui:ui-tooling" = ""
"androidx.compose.ui:ui-tooling-preview" = ""
"androidx.hilt:hilt-navigation-compose" = ""
"androidx.preference:preference-ktx" = ""
"androidx.test.espresso:espresso-contrib" = ""
"androidx.test.espresso:espresso-core" = ""
"androidx.test.espresso:espresso-intents" = ""
"androidx.test.ext:junit-ktx" = ""
"androidx.test.uiautomator:uiautomator" = ""
"androidx.test:rules" = ""
"app.cash.turbine:turbine" = ""
"com.adevinta.android:barista" = ""
"com.android.application" = ""
"com.android.tools.lint:lint" = ""
"com.android.tools.lint:lint-api" = ""
"com.android.tools.lint:lint-tests" = ""
"com.google.dagger.hilt.android" = ""
"com.google.dagger:hilt-android" = ""
"com.google.dagger:hilt-android-compiler" = ""
"com.google.dagger:hilt-android-testing" = ""
"com.google.dagger:hilt-compiler" = ""
"com.google.devtools.ksp" = ""
"com.google.pay.button:compose-pay-button" = ""
"com.lemonappdev:konsist" = ""
"com.pinterest.ktlint:ktlint-cli" = ""
"com.squareup.leakcanary:leakcanary-android" = ""
"com.squareup.moshi:moshi-adapters" = ""
"com.squareup.moshi:moshi-kotlin" = ""
"com.squareup.okhttp3:logging-interceptor" = ""
"com.squareup.okhttp3:mockwebserver" = ""
"com.squareup.retrofit2:converter-moshi" = ""
"com.squareup.retrofit2:retrofit" = ""
"io.gitlab.arturbosch.detekt" = ""
"io.gitlab.arturbosch.detekt:detekt-formatting" = ""
"jacoco" = ""
"org.bitbucket.b_c:jose4j" = ""
"org.jetbrains.dokka" = ""
"org.jetbrains.kotlinx.binary-compatibility-validator" = ""
"org.jetbrains.kotlinx:kotlinx-coroutines-test" = ""
"org.json:json" = ""
"org.junit.jupiter:junit-jupiter-api" = ""
"org.junit.jupiter:junit-jupiter-engine" = ""
"org.junit.jupiter:junit-jupiter-params" = ""
"org.junit.vintage:junit-vintage-engine" = ""
"org.mockito.kotlin:mockito-kotlin" = ""
"org.mockito:mockito-android" = ""
"org.mockito:mockito-junit-jupiter" = ""
"org.robolectric:robolectric" = ""
"org.sonarqube" = ""
# These are used in our SDK, but we already display Kotlin in through another dependency.
"kotlin-android" = ""
"kotlin-parcelize" = ""
"org.jetbrains.kotlin.android" = ""
"org.jetbrains.kotlin:kotlin-parcelize-runtime" = ""
23 changes: 23 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check

on:
workflow_call:

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Gradle check
run: ./gradlew check
94 changes: 69 additions & 25 deletions .github/workflows/check_labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,90 @@ name: Check Labels
# Every PR should have a label and some labels should include an update to the release notes
on:
pull_request:
branches-ignore:
- 'main'
types: [ synchronize, labeled, unlabeled ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
get_allowed_labels:
runs-on: ubuntu-latest

outputs:
allowed-labels: ${{ steps.get_allowed_labels.outputs.allowed_labels }}

steps:
- uses: actions/checkout@v4

- name: Get the list of allowed pull request labels
id: get_allowed_labels
env:
PROJECT_ROOT: ${{ github.workspace }}
run: |
RED='\033[0;31m'
FILE_NAME=.release_notes_allowed_labels_list
GITHUB_DIR=.github
FILE_PATH=$PROJECT_ROOT/$GITHUB_DIR/$FILE_NAME
if [[ ! -f "$FILE_PATH" ]]; then
echo -e "${RED}$FILE_NAME file doesn't exits in $GITHUB_DIR/"
exit 1
fi
ALLOWED_LABELS=$(cat $FILE_PATH)
echo -e "allowed_labels=$ALLOWED_LABELS" >> $GITHUB_OUTPUT
echo -e "Allowed labels are: $ALLOWED_LABELS"
labels-check:
# https://github.com/actions/virtual-environments/
runs-on: ubuntu-latest
needs: get_allowed_labels

steps:
- uses: actions/checkout@v4
- name: Check PR labels

- name: Validate release notes
env:
REQUIRED_PR_LABELS: "Breaking change,Feature,Fix"
OPTIONAL_PR_LABELS: "Dependencies,Chore"
ALLOWED_RELEASE_NOTES_LABELS: ${{ needs.get_allowed_labels.outputs.allowed-labels }}
PR_BODY: ${{ github.event.pull_request.body }}
run: |
all_pr_labels_json=$(cat <<EOF
# Fetch PR labels
ALL_PR_LABELS_JSON=$(cat <<EOF
${{ toJson(github.event.pull_request.labels.*.name) }}
EOF
)
all_pr_labels=$(jq -r '.[]' <<< "$all_pr_labels_json")
echo "PR labels: $all_pr_labels"
if [[ "${all_pr_labels[@]}" =~ 'Breaking change' || "${all_pr_labels[@]}" =~ 'Feature' || "${all_pr_labels[@]}" =~ 'Fix' ]]
then
echo "Checking if release notes were added..."
git fetch origin develop --depth 1
if [ -n "$(git diff origin/develop RELEASE_NOTES.md)" ]
then
echo "Release notes were updated."
exit 0
else
echo "::error::Add release notes for your PR by updating RELEASE_NOTES.md"
exit 1
ALL_PR_LABELS=$(jq -r '.[]' <<< "$ALL_PR_LABELS_JSON")
# Read PR labels into an array
IFS=',' read -r -a PR_LABELS <<< "$ALL_PR_LABELS"
echo "PR labels: $PR_LABELS"
# Initialize flags
REQUIRED_LABEL_MATCH=false
OPTIONAL_LABEL_MATCH=false
# Check labels against categories
for label in "${PR_LABELS[@]}"; do
# Check if a label exists in a comma-separated required labels list
if [[ ",$REQUIRED_PR_LABELS," == *",$label,"* ]]; then
REQUIRED_LABEL_MATCH=true
fi
elif [[ "${all_pr_labels[@]}" =~ 'Dependencies' || "${all_pr_labels[@]}" =~ 'Chore' ]]
then
echo "No extra actions needed for used labels"
exit 0
# Check if a label exists in a comma-separated optional labels list
if [[ ",$OPTIONAL_PR_LABELS," == *",$label,"* ]]; then
OPTIONAL_LABEL_MATCH=true
fi
echo "::error::You must add a valid label to this PR"
exit 1
done
# Handle matches
if [[ "$OPTIONAL_LABEL_MATCH" == "true" ]]; then
echo "This PR has an optional label. No release notes are required."
exit 0
elif [[ "$REQUIRED_LABEL_MATCH" == "true" ]]; then
echo "This PR has a required label. Checking release notes..."
chmod +x scripts/check_release_notes_labels.sh
scripts/check_release_notes_labels.sh
else
echo "Error: You must add a valid label to this PR."
exit 1
fi
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Check Develop
name: Check Main

on:
push:
branches:
- 'develop'
- 'main'

concurrency:
group: 'develop'
group: 'main'
cancel-in-progress: true

jobs:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Check PR

on:
pull_request:
branches-ignore:
- 'main'
types: [ opened, synchronize, reopened ]

concurrency:
Expand All @@ -30,3 +28,6 @@ jobs:
name: Validate public API
uses: ./.github/workflows/validate_public_api.yml
secrets: inherit
verify_dependencies:
name: Validate dependencies
uses: ./.github/workflows/validate_dependencies.yml
38 changes: 0 additions & 38 deletions .github/workflows/check_release.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/create_github_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Create github release

on:
workflow_call:
inputs:
version-name:
required: true
type: string

jobs:
create_github_release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Create a Github release with release notes.
- name: Create Github release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_NAME: ${{ inputs.version-name }}
with:
token: ${{ env.GITHUB_TOKEN }}
tag: ${{ env.VERSION_NAME }}
name: ${{ env.VERSION_NAME }}
draft: true
Loading

0 comments on commit 3350319

Please sign in to comment.