π :: v2.1.8 #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android DeployPlayStore Workflow | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 18 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '18' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Create google-services.json | |
env: | |
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
run: echo $DATA > /home/runner/work/JOBIS-ANDROID-V2/JOBIS-ANDROID-V2/app/google-services.json | |
- name: Create google-cloud-platform.json | |
env: | |
DATA: ${{ secrets.GOOGLE_CLOUD_PLATFORM }} | |
run: echo $DATA | base64 --decode > /home/runner/work/JOBIS-ANDROID-V2/JOBIS-ANDROID-V2/app/src/main/play/google-cloud-platform.json | |
- name: Create local.properties | |
run: | | |
echo "BASE_URL_PROD=${{ secrets.BASE_URL_PROD }}" >> ${{ github.workspace }}/local.properties | |
- name: Create keystore directory | |
run: mkdir -p ${{ github.workspace }}/app/keystore | |
- name: Decode Keystore | |
run: | | |
echo "$KEYSTORE" > ${{ github.workspace }}/app/keystore/keystore.b64 | |
base64 -d -i ${{ github.workspace }}/app/keystore/keystore.b64 > ${{ github.workspace }}/app/keystore/jobis_v2_key.jks | |
env: | |
KEYSTORE: ${{ secrets.APP_RELEASE_KEY_STORE }} | |
- name: Build Release And Publish AAB | |
run: ./gradlew publishReleaseBundle | |
env: | |
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} | |
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} | |
- name: Get version | |
id: get_version | |
run: | | |
echo "::set-output name=code::$(grep VERSION_CODE buildSrc/src/main/kotlin/ProjectProperties.kt | awk '{print $5}')" | |
echo "::set-output name=name::$(grep VERSION_NAME buildSrc/src/main/kotlin/ProjectProperties.kt | awk '{print $5}' | tr -d '"' )" | |
- name: Get tag name | |
id: get_tag | |
run: echo "::set-output name=name::v${{ steps.get_version.outputs.name }}" | |
- name: Get release note | |
id: read_file | |
run: | | |
echo "RELEASE_NOTE=$(cat ./app/src/main/play/release-notes/ko-KR/default.txt)" >> $GITHUB_ENV | |
- name: Generate Release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_name: "π :: ${{ steps.get_tag.outputs.name }}" | |
tag_name: ${{ steps.get_tag.outputs.name }} | |
draft: false | |
prerelease: false | |
- name: Notify Slack on Success | |
if: ${{ success() }} | |
id: slack-success | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
"channel": "${{ secrets.SLACK_DEPLOY_CHANNEL_ID }}", | |
"attachments": | |
[ | |
{ | |
"color": "#36a64f", | |
"title": "${{ github.repository }}", | |
"title_link": "https://github.com/${{github.repository}}", | |
"text": "π μ±μ΄ λ°°ν¬λμμ΅λλ€.", | |
"fields": | |
[ | |
{ | |
"title": "Repository", | |
"value": "${{ github.repository }}", | |
"short": true | |
}, | |
{ | |
"title": "Tag", | |
"value": "${{ github.ref_name }}", | |
"short": true | |
}, | |
{ | |
"title": "Version", | |
"value": "${{ steps.get_tag.outputs.name }}", | |
"short": true | |
}, | |
{ | |
"title": "Release Note", | |
"value": "${{ env.RELEASE_NOTE }}", | |
"short": false | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
- name: Notify Slack on Failure | |
if: ${{ failure() }} | |
id: slack-failure | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
"channel": "${{ secrets.SLACK_DEPLOY_CHANNEL_ID }}", | |
"attachments": | |
[ | |
{ | |
"color": "#ff0000", | |
"title": "${{ github.repository }}", | |
"title_link": "https://github.com/${{ github.repository }}", | |
"text": "π£ μ± λ°°ν¬μ μ€ν¨νμ΄μ γ γ ", | |
"fields": | |
[ | |
{ | |
"title": "Repository", | |
"value": "${{ github.repository }}", | |
"short": true | |
}, | |
{ | |
"title": "Tag", | |
"value": "${{ github.ref_name }}", | |
"short": true | |
}, | |
{ | |
"title": "Version", | |
"value": "${{ steps.get_tag.outputs.name }}", | |
"short": true | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |