Release Update #5
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: Release Update | |
on: | |
schedule: | |
- cron: 0 0 1 * * | |
workflow_dispatch: | |
inputs: | |
prerelease: | |
description: Prerelease | |
type: boolean | |
required: true | |
draft: | |
description: Draft | |
type: boolean | |
default: false | |
required: true | |
increment: | |
type: choice | |
description: Which to component to increment. | |
default: default | |
required: true | |
options: | |
- default | |
- major | |
- minor | |
- patch | |
jobs: | |
release-validation: | |
runs-on: ubuntu-latest | |
outputs: | |
next_version: ${{ steps.validate.outputs.next_version }} | |
greenlight: ${{ steps.validate.outputs.greenlight }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install Python packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install gitpython | |
- name: Release validation | |
id: validate | |
env: | |
INCREMENT: ${{ github.event.inputs.increment || 'default' }} | |
run: | | |
ls | |
python .github/release_helper.py | |
shell: bash | |
build-release-apk: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
if: needs.release-validation.outputs.greenlight == 'true' | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 21 | |
- uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-encryption-key: Da25KUVSE5jbGds2zXmfXw== | |
- name: Write sign info | |
if: github.repository_owner == 'LawnchairLauncher' | |
run: | | |
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: Build release APK | |
run: ./gradlew app:assembleRelease bundle:assembleRelease | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Release APK | |
path: | | |
app/build/outputs/apk/app/release/*.apk | |
app/build/outputs/bundle/release/*.aab | |
publish-github-release: | |
runs-on: ubuntu-latest | |
needs: build-release-apk | |
if: needs.release-validation.outputs.greenlight == 'true' | |
permissions: | |
contents: write | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Release APK | |
path: artifacts/release-apk | |
- name: Publish GitHub release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: v${{ needs.release-validation.outputs.next_version }} | |
prerelease: ${{ github.event.inputs.prerelease || 'false' }} | |
draft: ${{ github.event.inputs.draft }} | |
body_path: ${{ github.workspace }}/GITHUB_CHANGELOG.md | |
files: artifacts/release-apk/*.apk | |
name: Lawnicons ${{ needs.release-validation.outputs.next_version }} | |
publish-google-play-store-release: | |
runs-on: ubuntu-latest | |
needs: build-release-apk | |
if: needs.release-validation.outputs.greenlight == 'true' | |
permissions: | |
contents: write | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Release APK | |
path: artifacts/release-apk | |
- name: Publish Google Play Store release | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
packageName: app.lawnchair.lawnicons.play | |
releaseFiles: artifacts/release-apk/*.aab | |
releaseName: ${{ needs.release-validation.outputs.next_version }} | |
track: production | |
send-notifications: | |
runs-on: ubuntu-latest | |
needs: build-release-apk | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install Python packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install gitpython requests | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Release APK | |
path: artifacts/release-apk | |
- name: Send notifications | |
run: python send_notifications.py | |
env: | |
GITHUB_EVENT_BEFORE: ${{ github.event.before }} | |
TELEGRAM_CI_BOT_TOKEN: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }} | |
TELEGRAM_CI_CHANNEL_ID: ${{ secrets.TELEGRAM_CI_CHANNEL_ID }} | |
TELEGRAM_TEAM_GROUP_ID: ${{ secrets.TELEGRAM_TEAM_GROUP_ID }} | |
ARTIFACT_DIRECTORY: artifacts/release-apk | |
GITHUB_REF: ${{ github.ref }} |