Tweak CI configs (#3773)

* Tweak CI config

- Verify release build for every commit or PR, so that we can found potential obfuscation issues.
- Merge build_debug_apk.yml with build_release_apk.yml.
- Rename build_debug_apk.yml to ci.yml

* Cleanup

* Update ci.yml

* Fix release_update.yml

* Revert
This commit is contained in:
Goooler
2023-12-03 14:11:37 +08:00
committed by GitHub
parent acfe0ba3a6
commit cea154eb7d
3 changed files with 26 additions and 103 deletions

View File

@@ -1,77 +0,0 @@
name: Build release APK
on:
workflow_dispatch:
push:
branches:
- 12.1-alpha
jobs:
build-release-apk:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Write sign info
if: github.repository == 'LawnchairLauncher/lawnchair'
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 assembleLawnWithQuickstepRelease
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Release APK
path: |
build/outputs/apk/lawnWithQuickstep/release/*.apk
build/outputs/mapping/lawnWithQuickstepRelease/mapping.txt
send-notifications:
runs-on: ubuntu-latest
if: github.repository == 'LawnchairLauncher/lawnchair'
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@v4
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@v3
with:
name: Release APK
path: artifacts/release-apk
- name: Send notifications
run: python ci.py
env:
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }}
TELEGRAM_CI_CHANNEL_ID: ${{ secrets.TELEGRAM_CI_CHANNEL_ID }}
TELEGRAM_TEAM_GROUP_ID: ${{ secrets.NOTIFY_CHANNEL_ID }}
ARTIFACT_DIRECTORY: artifacts/release-apk
GITHUB_REF: ${{ github.ref }}
ACTION: internal_notifications

View File

@@ -1,8 +1,6 @@
name: Build debug APK
name: CI
on:
workflow_dispatch:
workflow_call:
push:
branches:
- '*-dev'
@@ -25,14 +23,15 @@ on:
- '**.md'
- 'LICENSE'
- 'NOTICE'
workflow_dispatch:
workflow_call:
jobs:
build-debug-apk:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Check out repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-java@v4
@@ -80,13 +79,11 @@ jobs:
if: github.repository_owner == 'LawnchairLauncher'
needs: build-debug-apk
steps:
- name: Check out repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Python packages

View File

@@ -1,4 +1,5 @@
name: Release update
on:
workflow_dispatch:
inputs:
@@ -18,12 +19,12 @@ on:
description: Release name
type: string
required: true
jobs:
build-release-apk:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-java@v4
@@ -31,17 +32,20 @@ jobs:
distribution: 'zulu'
java-version: 17
- uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Build release APK
run: ./gradlew assembleLawnWithQuickstepRelease
- name: Sign release APK
uses: r0adkll/sign-android-release@v1
id: sign-release-apk
with:
releaseDirectory: build/outputs/apk/lawnWithQuickstep/release
signingKeyBase64: ${{ secrets.KEYSTORE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- 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: Rename artifact
continue-on-error: true
run: mv "${{ steps.sign-release-apk.outputs.signedReleaseFile }}" "${{ github.event.inputs.artifactName }}"
@@ -50,14 +54,14 @@ jobs:
with:
name: Release APK
path: ${{ github.event.inputs.artifactName }}
publish-github-release:
runs-on: ubuntu-latest
needs: build-release-apk
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v3
with:
@@ -72,19 +76,18 @@ jobs:
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:
- name: Check out repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: Release APK
path: artifacts/release-apk
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install Python packages