Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Auto Release @potatochips#48

TakuSemba
February 17, 2018

Auto Release @potatochips#48

TakuSemba

February 17, 2018
Tweet

More Decks by TakuSemba

Other Decks in Programming

Transcript

  1. Auto Release
    TakuSemba
    CyberAgent.Inc

    View Slide

  2. @takusemba
    https://github.com/TakuSemba

    View Slide

  3. Release Step
    ɾpublish APK for alpha
    ɾpublish APK for production
    ɾmake a release note

    View Slide

  4. Release Step
    ɾpublish APK for alpha (Auto)
    ɾpublish APK for production (Manual)
    ɾmake a release note (Auto)

    View Slide

  5. Release Step
    ɾpublish APK for alpha (Auto)
    ɾpublish APK for production (Manual)
    ɾmake a release note (Auto)

    View Slide

  6. gradle-play-publisher

    View Slide

  7. https://github.com/Triple-T/gradle-play-publisher

    View Slide

  8. apply plugin: ‘com.github.triplet.play'
    android {
    playAccountConfigs {
    defaultAccountConfig {
    serviceAccountEmail = 'your-service-account-email'
    pk12File = file('key.p12')
    }
    }
    defaultConfig {
    // ...
    playAccountConfig = playAccountConfigs.defaultAccountConfig
    }
    }
    build.gradle

    View Slide

  9. apply plugin: ‘com.github.triplet.play'
    android {
    playAccountConfigs {
    defaultAccountConfig {
    serviceAccountEmail = 'your-service-account-email'
    pk12File = file('key.p12')
    }
    }
    defaultConfig {
    // ...
    playAccountConfig = playAccountConfigs.defaultAccountConfig
    }
    }
    build.gradle
    apply plugin: ‘com.github.triplet.play'

    View Slide

  10. apply plugin: ‘com.github.triplet.play'
    android {
    playAccountConfigs {
    defaultAccountConfig {
    serviceAccountEmail = 'your-service-account-email'
    pk12File = file('key.p12')
    }
    }
    defaultConfig {
    // ...
    playAccountConfig = playAccountConfigs.defaultAccountConfig
    }
    }
    build.gradle
    defaultAccountConfig {
    serviceAccountEmail = 'your-service-account-email'
    pk12File = file('key.p12')
    }

    View Slide

  11. apply plugin: ‘com.github.triplet.play'
    android {
    playAccountConfigs {
    defaultAccountConfig {
    serviceAccountEmail = 'your-service-account-email'
    pk12File = file('key.p12')
    }
    }
    defaultConfig {
    // ...
    playAccountConfig = playAccountConfigs.defaultAccountConfig
    }
    }
    build.gradle
    defaultConfig {
    // ...
    playAccountConfig = playAccountConfigs.defaultAccountConfig
    }

    View Slide

  12. play {
    track = 'alpha'
    userFraction = 1
    untrackOld = false
    errorOnSizeLimit = false
    uploadImages = true
    }
    build.gradle

    View Slide

  13. ./gradlew tasks --all

    View Slide

  14. ./gradlew app:bootstrapReleasePlayResources

    View Slide

  15. ./gradlew app:bootstrapReleasePlayResources

    View Slide

  16. my app does
    blah blah blah…

    View Slide

  17. my app does
    blah blah blah…
    and more blah…

    View Slide

  18. ./gradlew app:publishListingRelease
    my app does
    blah blah blah…
    and more blah…

    View Slide

  19. View Slide

  20. this release
    does something…

    View Slide

  21. ./gradlew app:publishApkRelease
    this release
    does something…

    View Slide

  22. Release Step
    ɾpublish APK for alpha (Auto)
    ɾpublish APK for production (Manual)
    ɾmake a release note (Auto)

    View Slide

  23. Release Step
    ɾpublish APK for alpha (Auto)
    ɾpublish APK for production (Manual)
    ɾmake a release note (Auto)

    View Slide

  24. release note

    View Slide

  25. https://developer.github.com/v3/repos/releases/

    View Slide

  26. curl -X POST \
    https://api.github.com/repos/TakuSemba/RepoName/releases \
    -H 'Authorization: token abcdefg’ \
    -d '{
    "tag_name": "release-3.0.15",
    "target_commitish": "release",
    "name": "release-3.0.15",
    "body": "Description of the release",
    "draft": true,
    "prerelease": false
    }'

    View Slide

  27. curl -X POST \
    https://api.github.com/repos/TakuSemba/RepoName/releases \
    -H 'Authorization: token abcdefg’ \
    -d '{
    "tag_name": "release-3.0.15",
    "target_commitish": "release",
    "name": "release-3.0.15",
    "body": "Description of the release",
    "draft": true,
    "prerelease": false
    }'
    https://api.github.com/repos/TakuSemba/RepoName/releases \

    View Slide

  28. curl -X POST \
    https://api.github.com/repos/TakuSemba/RepoName/releases \
    -H 'Authorization: token abcdefg’ \
    -d '{
    "tag_name": "release-3.0.15",
    "target_commitish": "release",
    "name": "release-3.0.15",
    "body": "Description of the release",
    "draft": true,
    "prerelease": false
    }'
    -d '{
    "tag_name": "release-3.0.15",
    "target_commitish": "release",
    "name": "release-3.0.15",
    "body": "Description of the release",
    "draft": true,
    "prerelease": false
    }'

    View Slide

  29. View Slide

  30. with CI

    View Slide

  31. When release tag pushed
    If
    TAG=$(git describe --exact-match --tags HEAD)
    if echo ${TAG} | grep -v release-; then
    echo "tag: " ${TAG}
    echo "failed: tag name does not contain 'release-'."
    exit 1
    fi
    DIFF=$(git diff origin/release..${TAG})
    if [ -n "$DIFF" ]; then
    echo ${DIFF}
    echo "failed: between origin/release and " ${TAG} "
    has diffs"
    exit 1
    fi

    View Slide

  32. With

    View Slide

  33. Auto Release
    https://github.com/takusemba
    https://twitter.com/takusemba

    View Slide