Skip to content

Build Release Google Play #14

Build Release Google Play

Build Release Google Play #14

name: Build Release
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
run_debug:
description: "Run Build Debug (true/false)"
required: false
default: "false"
concurrency:
group: 'release'
cancel-in-progress: false
jobs:
publishPlay:
environment:
name: Release-Play
name: Build Arcticons Bundle
if: startsWith(github.ref, 'refs/tags/') && (github.event_name != 'workflow_dispatch' || inputs.run_debug == 'false')
runs-on: ubuntu-latest
steps:
- name: Checking out branch
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
cache: gradle
- name: Write sign info
run: |
echo "Workflow manually triggered by ${{ github.actor }}"
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> keystore.properties
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> keystore.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties
echo storeFile='${{ github.workspace }}/key.jks' >> keystore.properties
echo ${{ secrets.KEYSTORE }} | base64 --decode > ${{ github.workspace }}/key.jks
fi
- name: Get Gradle
run: gradle wrapper
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Normal Bundle
run: ./gradlew app:bundleNormalPlayRelease
- name: Build Black Bundle
run: ./gradlew app:bundleBlackPlayRelease
- name: Build You Bundle
run: ./gradlew app:bundleYouPlayRelease
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- run: |
pip install markdown
pip install beautifulsoup4
- name: Create Changelog
run: |
mkdir whatsnew
python .github/workflows/mark2text.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: |
app/build/outputs/bundle/normalPlayRelease/*.aab
app/build/outputs/bundle/blackPlayRelease/*.aab
app/build/outputs/bundle/youPlayRelease/*.aab
# Step: Upload APK/AAB to Google Play
- name: Upload Normal to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
packageName: 'com.donnnno.arcticons' # Replace with your app's package name
releaseFiles: app/build/outputs/bundle/normalPlayRelease/*.aab # Path to your APK/AAB
track: production # Options: production, beta, alpha, internal
status: completed # Options: draft, inProgress, halted, completed
whatsNewDirectory: whatsnew
- name: Upload Black to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
packageName: 'com.donnnno.arcticons.light' # Replace with your app's package name
releaseFiles: app/build/outputs/bundle/blackPlayRelease/*.aab # Path to your APK/AAB
track: production # Options: production, beta, alpha, internal
status: completed # Options: draft, inProgress, halted, completed
whatsNewDirectory: whatsnew
- name: Upload You to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
packageName: 'com.donnnno.arcticons.you.play' # Replace with your app's package name
releaseFiles: app/build/outputs/bundle/youPlayRelease/*.aab # Path to your APK/AAB
track: production # Options: production, beta, alpha, internal
status: completed # Options: draft, inProgress, halted, completed
whatsNewDirectory: whatsnew
build:
name: Build Arcticons APK
if: startsWith(github.ref, 'refs/tags/') && (github.event_name != 'workflow_dispatch' || inputs.run_debug == 'false')
runs-on: ubuntu-latest
steps:
- name: Checking out branch
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
cache: gradle
- name: Write sign info
run: |
echo "Workflow manually triggered by ${{ github.actor }}"
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> keystore.properties
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> keystore.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties
echo storeFile='${{ github.workspace }}/key.jks' >> keystore.properties
echo ${{ secrets.KEYSTORE }} | base64 --decode > ${{ github.workspace }}/key.jks
fi
- name: Get Gradle
run: gradle wrapper
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Normal APK
run: ./gradlew app:assemblenormalRelease
- name: Build Black APK
run: ./gradlew app:assembleblackRelease
- name: Build You APK
run: ./gradlew app:assembleyouRelease
- name: Build Day&Night
run: ./gradlew app:assembledayNightRelease
- name: Get Release Notes
id: image
run: |
name="$GITHUB_REF_NAME Release"
image="![releaseImage](https://github.com/Arcticons-Team/Arcticons/blob/$GITHUB_REF_NAME/generated/releaseImage.webp)"
changelog=$(< ./generated/changelog.md)
changelog="$changelog
$image"
gh release create $GITHUB_REF_NAME --generate-notes --title "$name" --notes "$changelog" --discussion-category "Announcements" app/build/outputs/apk/normal/release/*.apk app/build/outputs/apk/black/release/*.apk app/build/outputs/apk/dayNight/release/*.apk app/build/outputs/apk/you/release/*.apk
env:
GH_TOKEN: ${{ github.token }}
debug:
name: Build Arcticons Debug APK
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_debug == 'true' }}
steps:
- name: Checking out branch
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
cache: gradle
- name: Write sign info
run: |
echo "Workflow manually triggered by ${{ github.actor }}"
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> keystore.properties
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> keystore.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties
echo storeFile='${{ github.workspace }}/key.jks' >> keystore.properties
echo ${{ secrets.KEYSTORE }} | base64 --decode > ${{ github.workspace }}/key.jks
fi
- name: Get Gradle
run: gradle wrapper
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Lint Checks
run: |
gradle app:lintNormalDebug
gradle app:lintBlackDebug
gradle app:lintDayNightDebug
gradle app:lintYouDebug
- name: Build debug APK
run: ./gradlew app:assembleDebug
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: |
app/build/outputs/apk/black/debug/*.apk
app/build/outputs/apk/blackPlay/debug/*.apk
app/build/outputs/apk/dayNight/debug/*.apk
app/build/outputs/apk/normal/debug/*.apk
app/build/outputs/apk/normalPlay/debug/*.apk
app/build/outputs/apk/you/debug/*.apk
app/build/outputs/apk/youPlay/debug/*.apk
app/build/reports/*