mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-10 06:42:05 +01:00
156 lines
4.7 KiB
YAML
156 lines
4.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
BuildBinaries:
|
|
name: Build application packages
|
|
strategy:
|
|
matrix:
|
|
runtime: [ linux-x64, linux-fedora-x64, osx-x64, win-x64, android ]
|
|
include:
|
|
- runtime: linux-x64
|
|
arch: x64
|
|
os: ubuntu-latest
|
|
shell: bash
|
|
build: packageReleaseUberJarForCurrentOS packageDeb
|
|
setupCl: ./scripts/SetupClUnix.sh
|
|
|
|
- runtime: linux-fedora-x64
|
|
arch: x64
|
|
os: ubuntu-latest
|
|
shell: bash
|
|
build: packageReleaseRpm
|
|
setupCl: ./scripts/SetupClUnix.sh
|
|
|
|
- runtime: osx-x64
|
|
arch: x64
|
|
os: macOS-latest
|
|
shell: bash
|
|
build: packageReleaseUberJarForCurrentOS packageReleaseDmg notarizeReleaseDmg
|
|
setupCl: ./scripts/SetupClUnix.sh
|
|
|
|
- runtime: win-x64
|
|
arch: x64
|
|
os: windows-latest
|
|
shell: powershell
|
|
build: packageReleaseUberJarForCurrentOS packageReleaseMsi
|
|
setupCl: ./scripts/SetupClWindows.ps1
|
|
|
|
- runtime: android
|
|
arch: x64
|
|
os: ubuntu-latest
|
|
shell: bash
|
|
build: :android:assembleRelease
|
|
setupCl: ./scripts/SetupClUnix.sh
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 60
|
|
defaults:
|
|
run:
|
|
shell: ${{ matrix.shell }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-java@v3
|
|
if: ${{ matrix.runtime != 'linux-fedora-x64' }}
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '17'
|
|
architecture: ${{ matrix.arch }}
|
|
|
|
- name: Setup Cl
|
|
run: ${{ matrix.setupCl }}
|
|
|
|
- name: Setup MacOS Keychain
|
|
uses: apple-actions/import-codesign-certs@v1
|
|
if: ${{ matrix.runtime == 'osx-x64' }}
|
|
with:
|
|
p12-file-base64: ${{ secrets.APPLE_CERT }}
|
|
p12-password: ${{ secrets.APPLE_CERT_PASSWORD }}
|
|
|
|
- name: Build rpm Package
|
|
if: ${{ matrix.runtime == 'linux-fedora-x64' }}
|
|
uses: Syer10/Fedora-Java17-Action@v1
|
|
with:
|
|
command: ./gradlew ${{ matrix.build }} --stacktrace
|
|
|
|
- name: Build
|
|
if: ${{ matrix.runtime != 'linux-fedora-x64' }}
|
|
uses: gradle/gradle-build-action@v2
|
|
with:
|
|
arguments: >
|
|
${{ matrix.build }}
|
|
-Pcompose.desktop.mac.sign=true
|
|
-Pcompose.desktop.mac.signing.identity=${{ secrets.APPLE_IDENTITY_SHORT }}
|
|
-Pcompose.desktop.mac.notarization.appleID=${{ secrets.APPLE_ID }}
|
|
-Pcompose.desktop.mac.notarization.password=${{ secrets.APPLE_PASSWORD }}
|
|
-Pidentity="${{ secrets.APPLE_IDENTITY }}"
|
|
|
|
- name: Sign APK
|
|
uses: r0adkll/sign-android-release@v1
|
|
if: ${{ matrix.runtime == 'android' }}
|
|
with:
|
|
releaseDirectory: android/build/outputs/apk/release
|
|
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
|
|
alias: ${{ secrets.ANDROID_KEY_ALIAS }}
|
|
keyStorePassword: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
|
|
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
|
|
|
# Upload runner package tar.gz/zip as artifact
|
|
- name: Publish Artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: runner-package-${{ matrix.runtime }}
|
|
path: |
|
|
desktop/build/compose/binaries/main/*/
|
|
desktop/build/compose/jars/
|
|
!desktop/build/compose/binaries/main/app/
|
|
${{ env.SIGNED_RELEASE_FILE }}
|
|
|
|
# Upload runner errors
|
|
- name: Upload error logs
|
|
uses: actions/upload-artifact@v3
|
|
if: ${{ failure() }}
|
|
with:
|
|
name: runner-errors-${{ matrix.runtime }}
|
|
path: |
|
|
desktop/build/compose/logs/
|
|
ReleaseBinaries:
|
|
name: Make a release
|
|
needs: [ BuildBinaries ]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Download Build Artifacts
|
|
uses: actions/download-artifact@v3
|
|
|
|
- name: Fix rpm java dependency
|
|
uses: Syer10/Fedora-Java17-Action@v1
|
|
with:
|
|
command: ./scripts/RpmDependencyFix.sh
|
|
|
|
- name: Fix deb java dependency
|
|
run: ./scripts/DebDependencyFix.sh
|
|
|
|
- name: Fix filenames
|
|
run: ./scripts/NamingFix.sh
|
|
|
|
- uses: ncipollo/release-action@v1
|
|
with:
|
|
artifacts: "*/binaries/main/*/*.*,*/jars/*.jar,*/android/build/outputs/apk/release/*.apk"
|
|
draft: true
|
|
token: ${{ secrets.WINGET_PUBLISH_PAT }}
|