Skip to content

Release update

Release update #12

name: Release update
on:
workflow_dispatch:
inputs:
artifactName:
description: Artifact name
type: string
required: true
tagName:
description: Tag name
type: string
required: true
prerelease:
description: Prerelease
type: boolean
required: true
releaseName:
description: Release name
type: string
required: true
jobs:
build-release-apk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
- name: Write sign info
id: sign-release-apk
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 assembleLawnWithQuickstepMarketRelease
- name: Rename artifact
run: mv build/outputs/apk/**/*.apk "${{ github.event.inputs.artifactName }}"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Release APK
path: ${{ github.event.inputs.artifactName }}
publish-github-release:
runs-on: ubuntu-latest
needs: build-release-apk
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- 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: ${{ github.event.inputs.tagName }}
prerelease: ${{ github.events.inputs.prerelease }}
draft: true
body_path: ${{ github.workspace }}/GITHUB_CHANGELOG.md
files: artifacts/release-apk/${{ github.event.inputs.artifactName }}
name: ${{ github.event.inputs.releaseName }}
publish-telegram-update-post:
runs-on: ubuntu-latest
needs: build-release-apk
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Release APK
path: artifacts/release-apk
- 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: Publish Telegram update post
run: python ci.py
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }}
ARTIFACT_DIRECTORY: artifacts/release-apk
TELEGRAM_NEWS_CHANNEL_ID: ${{ secrets.TELEGRAM_NEWS_CHANNEL_ID }}
ACTION: update_announcement