π :: v2.2.6 #23
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 | |
echo "TERMS_URL=\"${{ secrets.TERMS_URL }}\"" >> ${{ 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: Read and format release notes | |
id: read_release_note | |
run: | | |
RELEASE_NOTE=$(cat ./app/src/main/play/release-notes/ko-KR/default.txt | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g') | |
echo "RELEASE_NOTE=$RELEASE_NOTE" >> $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 Discord on Success | |
if: success() | |
id: discord-success | |
run: | | |
curl -H "Content-Type: application/json" \ | |
-d '{"content": "π μ±μ΄ λ°°ν¬λμμ΅λλ€.\nπ·οΈ Tag: ${{ github.ref_name }}\nβοΈ Version: ${{ steps.get_tag.outputs.name }}\nπ Release Note:\n${{ env.RELEASE_NOTE }}"}' \ | |
${{ secrets.DISCORD_WEBHOOK_URL }} | |
- name: Notify Discord on Failure | |
id: discord-failure | |
if: failure() | |
run: | | |
curl -H "Content-Type: application/json" \ | |
-d '{"content": "π£ μ± λ°°ν¬μ μ€ν¨νμ΄μ γ γ \nTag: ${{ github.ref_name }}\nVersion: ${{ steps.get_tag.outputs.name }}"}' \ | |
${{ secrets.DISCORD_WEBHOOK_URL }} |