Skip to content

chore(release): 3.8.0 #85

chore(release): 3.8.0

chore(release): 3.8.0 #85

Workflow file for this run

name: Release build
on:
push:
tags:
- '*.*.*'
env:
USE_LOCAL_DEPENDENCY: ${{ vars.USE_LOCAL_DEPENDENCY }}
RELEASE_MODE: true
ANDROID_RELEASE_STORE_FILE_BASE64: ${{ secrets.ANDROID_RELEASE_STORE_FILE_BASE64 }}
ANDROID_RELEASE_STORE_PASSWORD: ${{ secrets.ANDROID_RELEASE_STORE_PASSWORD }}
ANDROID_RELEASE_KEY_ALIAS: ${{ secrets.ANDROID_RELEASE_KEY_ALIAS }}
ANDROID_RELEASE_KEY_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }}
FIREBASE_PROJECT_ID: ${{ vars.FIREBASE_PROJECT_ID }}
FIREBASE_SERVICE_ACCOUNT_JSON: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
GOOGLE_OAUTH_SERVER_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_SERVER_CLIENT_ID }}
GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}
GOOGLE_PLAY_STORE_SEVICE_ACCOUNT_JSON_BASE64: ${{ secrets.GOOGLE_PLAY_STORE_SEVICE_ACCOUNT_JSON_BASE64 }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
SONATYPE_SIGNING_KEY_ID: ${{ secrets.SONATYPE_SIGNING_KEY_ID }}
SONATYPE_SIGNING_PASSWORD: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
SONATYPE_SIGNING_SECRET_KEY_RING_FILE_BASE64: ${{ secrets.SONATYPE_SIGNING_SECRET_KEY_RING_FILE_BASE64 }}
RELEASE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD }}
RELEASE_KEY_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }}
RELEASE_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
RELEASE_STORE_FILE: ${{ secrets.RELEASE_STORE_FILE }}
DEVELOPMENT_MODE: ${{ secrets.DEVELOPMENT_MODE }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_ICON: https://icons.iconarchive.com/icons/martz90/circle/256/android-icon.png
SLACK_TITLE: New SDK Release
SLACK_USERNAME: Emarsys SDK - Android
EXCLUDE_GOOGLE_SERVICES_API_KEY: true
SIGNING_SECRET_KEY_RING_FILE: /home/runner/work/android-emarsys-sdk/android-emarsys-sdk/secring.asc.gpg
SIGNING_KEYID: ${{ secrets.SIGNING_KEYID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
jobs:
Release:
runs-on: ubuntu-latest
name: Release the SDK
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0 # 0 indicates all history
- run: git fetch --all || echo "==> Accept any result"
- name: set up JDK 1.17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: setup RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Prepare CI
run: make prepare-ci
- name: Release with Gradle
run: make release
CreateSampleReleaseBundle:
name: Create release bundle from sample app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0 # 0 indicates all history
- run: git fetch --all || echo "==> Accept any result"
- name: set up JDK 1.17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Prepare CI
run: make prepare-ci
- name: Prepare sample release
run: make prepare-sample-release
- name: Create sample app release bundle
run: make create-sample-release-bundle
- name: Upload bundle
uses: actions/upload-artifact@v4
with:
name: mobile-sdk-sample
path: sample/build/outputs/bundle/release/sample-release.aab
ReleaseSample:
name: Release sample app
runs-on: ubuntu-latest
needs: [Release, CreateSampleReleaseBundle]
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0 # 0 indicates all history
- run: git fetch --all || echo "==> Accept any result"
- name: set up JDK 1.17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Download sample app
uses: actions/download-artifact@v4
with:
name: mobile-sdk-sample
- name: Prepare sample release
run: make prepare-sample-release
- name: PlayStore upload
uses: r0adkll/[email protected]
with:
serviceAccountJson: ./sample/google-play-store-service-account.json
packageName: com.emarsys.sample
releaseFiles: sample-release.aab
- name: setup RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Create Release Page
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ github.ref }}
body_path: changelog.md
draft: false
prerelease: false
SlackNotification:
name: Send slack notification
runs-on: ubuntu-latest
needs: [ReleaseSample]
steps:
- name: setup RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Slack Notification - CI
uses: megamegax/[email protected]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_MOBILE_TEAM_CI_CHANNEL_WEBHOOK }}
with:
channel: '${{env.SLACK_CHANNEL}}'
message: 'Emarsys SDK ${{env.RELEASE_VERSION}} release has been started to the mavenCentral! It will be available there in a few hours. :man-gesturing-ok: :bananadance:'
user_name: '${{env.SLACK_USERNAME}}'
job_status: 'success'
user_icon: '${{env.SLACK_ICON}}'
actions: '[{ "type": "button", "text": "View actions", "url": "https://github.com/emartech/android-emarsys-sdk/actions" },{ "type": "button", "text": "View Firebase", "url": "https://console.firebase.google.com/project/ems-mobile-sdk/testlab/histories/" },{ "type": "button", "text": "Install page", "url": "http://ems-mobileteam-artifacts.s3-website-eu-west-1.amazonaws.com/index-ems.html" }]'
- name: Slack Notification - SDK Channel
uses: megamegax/[email protected]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_TEAM_MOBILE_SDK_CHANNEL_WEBHOOK }}
with:
channel: 'team-mobile-sdk'
message: 'Emarsys SDK ${{env.RELEASE_VERSION}} release has been started to the mavenCentral! It will be available there in a few hours. :man-gesturing-ok: :bananadance:'
user_name: '${{env.SLACK_USERNAME}}'
job_status: 'success'
user_icon: '${{env.SLACK_ICON}}'
actions: '[{ "type": "button", "text": "View actions", "url": "https://github.com/emartech/android-emarsys-sdk/actions" },{ "type": "button", "text": "View Firebase", "url": "https://console.firebase.google.com/project/ems-mobile-sdk/testlab/histories/" },{ "type": "button", "text": "Install page", "url": "http://ems-mobileteam-artifacts.s3-website-eu-west-1.amazonaws.com/index-ems.html" }]'
- name: Slack Notification - Mobile Apps Channel
uses: megamegax/[email protected]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_MOBILE_APPS_CHANNEL_WEBHOOK }}
with:
channel: 'mobile-apps'
message: 'Emarsys SDK ${{env.RELEASE_VERSION}} release has been started to the mavenCentral! It will be available there in a few hours. :man-gesturing-ok: :bananadance:'
user_name: '${{env.SLACK_USERNAME}}'
job_status: 'success'
user_icon: '${{env.SLACK_ICON}}'
actions: '[{ "type": "button", "text": "View actions", "url": "https://github.com/emartech/android-emarsys-sdk/actions" },{ "type": "button", "text": "View Firebase", "url": "https://console.firebase.google.com/project/ems-mobile-sdk/testlab/histories/" },{ "type": "button", "text": "Install page", "url": "http://ems-mobileteam-artifacts.s3-website-eu-west-1.amazonaws.com/index-ems.html" }]'
CreateJiraTicket:
name: Create Jira ticket
runs-on: ubuntu-latest
needs: [ReleaseSample]
steps:
- name: Login to Jira
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: setup RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Create a ticket
id: create
uses: atlassian/gajira-create@master
with:
project: ${{ secrets.JIRA_PROJECT }}
issuetype: Product docs
fields: ${{ secrets.JIRA_TICKET_JSON }}
summary: |
New Emarsys SDK release on Android
description: |
Emarsys SDK ${{env.RELEASE_VERSION}} has been released!
OnError:
name: Handle on Error
runs-on: ubuntu-latest
needs: [ReleaseSample]
if: ${{ failure() }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0 # 0 indicates all history
- run: git fetch --all || echo "==> Accept any result"
- name: setup RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: prepare to revert release
run: chmod +x revoke.sh
- name: Slack Notification
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_MOBILE_TEAM_CI_CHANNEL_WEBHOOK }}
uses: megamegax/[email protected]
with:
channel: '${{env.SLACK_CHANNEL}}'
message: 'Release failed! :man-gesturing-no: :blobcatfearful:'
user_name: '${{env.SLACK_USERNAME}}'
job_status: 'failure'
user_icon: '${{env.SLACK_ICON}}'
actions: '[{ "type": "button", "text": "View actions", "url": "https://github.com/emartech/android-emarsys-sdk/actions" },{ "type": "button", "text": "View Firebase", "url": "https://console.firebase.google.com/project/ems-mobile-sdk/testlab/histories/" }]'