Release #12
This file contains hidden or 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
| permissions: | |
| contents: read | |
| name: 'Release' | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| get-version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version_code: ${{ steps.extract_version.outputs.version_code }} | |
| version_name: ${{ steps.extract_version.outputs.version_name }} | |
| steps: | |
| - name: 'Checkout repository' | |
| uses: actions/checkout@v6 | |
| - name: 'Extract versions from androidApp/build.gradle.kts' | |
| id: extract_version | |
| run: | | |
| VERSION_CODE=$(grep "versionCode" androidApp/build.gradle.kts | sed 's/[^0-9]*//g') | |
| VERSION_NAME=$(grep "versionName" androidApp/build.gradle.kts | cut -d '"' -f 2) | |
| echo "Извлечено: versionCode=${VERSION_CODE}, versionName=${VERSION_NAME}" | |
| echo "version_code=$VERSION_CODE" >> $GITHUB_OUTPUT | |
| echo "version_name=$VERSION_NAME" >> $GITHUB_OUTPUT | |
| prepare-changelog: | |
| runs-on: ubuntu-latest | |
| needs: get-version | |
| outputs: | |
| release_body: ${{ steps.generate_changelog.outputs.body }} | |
| steps: | |
| - name: 'Checkout repository' | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: 'Setup Python' | |
| uses: actions/setup-python@v5 | |
| - name: 'Generate changelog' | |
| id: generate_changelog | |
| run: | | |
| echo 'body<<EOF' >> $GITHUB_OUTPUT | |
| python .github/scripts/generate_changelog.py \ | |
| ${{ needs.get-version.outputs.version_code }} \ | |
| ${{ needs.get-version.outputs.version_name }} \ | |
| ${{ github.repository }} >> $GITHUB_OUTPUT | |
| echo 'EOF' >> $GITHUB_OUTPUT | |
| build-android: | |
| runs-on: ubuntu-latest | |
| needs: get-version | |
| steps: | |
| - name: 'Checkout repository' | |
| uses: actions/checkout@v6 | |
| - name: 'Setup JDK 21' | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: 'Setup Gradle' | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: 'Grant execution permission to Gradle Wrapper' | |
| run: chmod +x gradlew | |
| - name: 'Build all flavors' | |
| run: ./gradlew :androidApp:assembleRelease | |
| # ================= ShikiApp ================= | |
| - name: 'Sign ShikiApp' | |
| id: sign_shikiapp | |
| uses: ilharp/sign-android-release@v2 | |
| with: | |
| releaseDir: androidApp/build/outputs/apk/ShikiApp/release | |
| signingKey: ${{ secrets.ANDROID_SIGNING_KEY }} | |
| keyAlias: ${{ secrets.ANDROID_KEY_ALIAS }} | |
| keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
| keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
| - name: 'Rename signed ShikiApp .apk' | |
| run: | | |
| SIGNED_APK_FILE=$(find ${{ steps.sign_shikiapp.outputs.signedFile }} -name '*.apk' | head -n 1) | |
| mv "$SIGNED_APK_FILE" "ShikiApp.apk" | |
| - name: 'Upload ShikiApp APK as artifact' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ShikiApp-apk | |
| path: ShikiApp.apk | |
| # ================= DarkShiki ================= | |
| - name: 'Sign DarkShiki' | |
| id: sign_dark | |
| uses: ilharp/sign-android-release@v2 | |
| with: | |
| releaseDir: androidApp/build/outputs/apk/DarkShiki/release | |
| signingKey: ${{ secrets.ANDROID_SIGNING_KEY }} | |
| keyAlias: ${{ secrets.ANDROID_KEY_ALIAS }} | |
| keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
| keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
| - name: 'Rename signed DarkShiki .apk' | |
| run: | | |
| SIGNED_APK_FILE=$(find ${{ steps.sign_dark.outputs.signedFile }} -name '*.apk' | head -n 1) | |
| mv "$SIGNED_APK_FILE" "DarkShiki.apk" | |
| - name: 'Upload DarkShiki APK as artifact' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: DarkShiki-apk | |
| path: DarkShiki.apk | |
| build-windows: | |
| runs-on: windows-latest | |
| needs: get-version | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - uses: gradle/actions/setup-gradle@v5 | |
| - name: 'Build Windows Portable Zip' | |
| run: ./gradlew :composeApp:packageZipDistributable | |
| - name: 'Upload Windows Zip as artifact' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: windows-zip | |
| path: composeApp/build/distributions/*-portable.zip | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| needs: get-version | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - uses: gradle/actions/setup-gradle@v5 | |
| - run: chmod +x gradlew | |
| - name: 'Build Linux files' | |
| run: ./gradlew :composeApp:createReleaseDistributable | |
| - name: 'Package Portable Linux Build' | |
| run: | | |
| cd composeApp/build/compose/binaries/main-release/app | |
| tar -czvf ShikiApp-linux-portable.tar.gz ShikiApp/ | |
| - name: 'Upload Linux Portable as artifact' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-portable | |
| path: composeApp/build/compose/binaries/main-release/app/ShikiApp-linux-portable.tar.gz | |
| create-release: | |
| runs-on: ubuntu-latest | |
| needs: [ get-version, prepare-changelog, build-android, build-windows, build-linux ] | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: 'Checkout repository' | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: 'Download ShikiApp APK' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ShikiApp-apk | |
| - name: 'Download DarkShiki APK' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: DarkShiki-apk | |
| - name: 'Download Windows Zip' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: windows-zip | |
| - name: 'Download Linux Tar' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-portable | |
| - name: 'Push Tag' | |
| run: | | |
| git config user.name "GitHub Actions Bot" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag ${{ needs.get-version.outputs.version_name }} | |
| git push origin ${{ needs.get-version.outputs.version_name }} | |
| - name: 'Create GitHub release' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.get-version.outputs.version_name }} | |
| body: ${{ needs.prepare-changelog.outputs.release_body }} | |
| files: | | |
| ShikiApp.apk | |
| DarkShiki.apk | |
| *-portable.zip | |
| *-portable.tar.gz |