make webview 1x1 pixel #4
Workflow file for this run
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" | |
on: | |
push: | |
tags: | |
- "1.*" | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
jobs: | |
flutter-build-android: | |
name: "Release for android" | |
runs-on: "ubuntu-latest" | |
permissions: write-all | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Extract tag name | |
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
shell: bash | |
- name: Echo build progress | |
run: echo "Kazumi_android_${{ env.tag }}.apk build progress" | |
shell: bash | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev libasound2-dev | |
shell: bash | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version-file: pubspec.yaml | |
- name: Get Flutter dependencies | |
run: flutter pub get | |
shell: bash | |
- name: Build Flutter for Android | |
run: flutter build apk --split-per-abi | |
shell: bash | |
- name: Package android build output | |
run: cp build/app/outputs/flutter-apk/app-arm64-v8a-release.apk Kazumi_android_${env:tag}.apk | |
shell: bash | |
- name: Upload android outputs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: android_outputs | |
path: Kazumi_android_*.apk | |
flutter-build-windows: | |
name: "Release for windows" | |
runs-on: "windows-latest" | |
permissions: write-all | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- run: | | |
$tag = "${{ github.ref }}".Replace('refs/tags/', '') | |
echo "tag=$(echo $tag)" >> $env:GITHUB_ENV | |
- run: echo "Kazumi_windows_${env:tag}.zip build progress" | |
- run: choco install yq | |
- name: Enable Git longpaths | |
run: git config --system core.longpaths true | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version-file: pubspec.yaml | |
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache | |
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path | |
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies | |
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '18' | |
- run: flutter pub get | |
- run: flutter build windows | |
# - name: Download FFmpeg Assets | |
# uses: dsaltares/fetch-gh-release-asset@master | |
# with: | |
# repo: 'Predidit/avbuild' | |
# version: 'tags/1.1.0' | |
# file: 'ffmpeg_windows_x64.zip' | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# - run: Remove-Item -Path build/windows/x64/runner/Release/ffmpeg-7.dll -Force | |
# - run: Expand-Archive -LiteralPath ffmpeg_windows_x64.zip -DestinationPath build/windows/x64/runner/Release | |
- run: Compress-Archive build/windows/x64/runner/Release/* Kazumi_windows_${env:tag}.zip | |
- name: Upload windows outputs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows_outputs | |
path: | | |
Kazumi_windows_*.zip | |
flutter-build-linux: | |
name: "Release for Linux" | |
runs-on: "ubuntu-latest" | |
permissions: write-all | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Extract tag name | |
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
shell: bash | |
- name: Echo build progress | |
run: echo "Kazumi_linux_${{ env.tag }}.tar.gz build progress" | |
shell: bash | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev unzip webkit2gtk-4.1 libasound2-dev | |
shell: bash | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version-file: pubspec.yaml | |
- name: Get Flutter dependencies | |
run: flutter pub get | |
shell: bash | |
- name: Build Flutter for Linux | |
run: flutter build linux | |
shell: bash | |
# - name: Download FFmpeg Assets | |
# uses: dsaltares/fetch-gh-release-asset@master | |
# with: | |
# repo: 'Predidit/avbuild' | |
# version: 'tags/1.1.0' | |
# file: 'ffmpeg_linux_amd64.zip' | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# - run: rm -f build/linux/x64/release/bundle/lib/libffmpeg.so.7 | |
# - run: unzip ffmpeg_linux_amd64.zip -d build/linux/x64/release/bundle/lib | |
- name: Package linux build output | |
run: | | |
# Tarball package | |
tar -zcvf Kazumi_linux_${{ env.tag }}_amd64.tar.gz -C build/linux/x64/release/bundle . | |
# Debian package | |
mkdir Kazumi_linux_${{ env.tag }}_amd64 | |
cd Kazumi_linux_${{ env.tag }}_amd64 | |
mkdir -p opt/Kazumi | |
mkdir -p usr/share/applications | |
mkdir -p usr/share/icons/hicolor/512x512/apps | |
cp -r ../build/linux/x64/release/bundle/* opt/Kazumi | |
cp -r ../assets/linux/DEBIAN . | |
chmod 0755 DEBIAN/postinst | |
chmod 0755 DEBIAN/postrm | |
cat>DEBIAN/control<<EOF | |
Maintainer: madoka773 <[email protected]> | |
Package: Kazumi | |
Version: ${{ env.tag }} | |
Section: x11 | |
Priority: optional | |
Architecture: amd64 | |
Essential: no | |
Installed-Size: 34648 | |
Description: Watch Animes online with danmaku support. | |
Homepage: https://github.com/Predidit/Kazumi | |
Depends: libayatana-appindicator3-1, | |
gir1.2-ayatanaappindicator3-0.1, | |
libwebkit2gtk-4.1-0 | |
EOF | |
cp ../assets/linux/io.github.Predidit.Kazumi.desktop usr/share/applications | |
cp ../assets/images/logo/logo_linux.png usr/share/icons/hicolor/512x512/apps/io.github.Predidit.Kazumi.png | |
cd .. | |
dpkg-deb --build --root-owner-group Kazumi_linux_${{ env.tag }}_amd64 | |
shell: bash | |
- name: Upload linux outputs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux_outputs | |
path: | | |
Kazumi_linux_*.tar.gz | |
Kazumi_linux_*.deb | |
flutter-build-ios: | |
name: "Release for iOS" | |
runs-on: "macos-latest" | |
permissions: write-all | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Extract tag name | |
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Echo build progress | |
run: echo "Kazumi_ios_${{ env.tag }}.ipa build progress" | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version-file: pubspec.yaml | |
- run: flutter pub get | |
- name: Build IPA | |
run: | | |
flutter build ios --release --no-codesign | |
- name: Create IPA | |
run: | | |
mkdir Payload | |
cp -R build/ios/iphoneos/Runner.app Payload/Runner.app | |
zip -q -r Kazumi_ios_${{ env.tag }}_no_sign.ipa Payload | |
- name: Upload iOS build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ios_outputs | |
path: Kazumi_ios_*.ipa | |
flutter-build-macos: | |
name: "Release for Macos" | |
runs-on: "macos-latest" | |
permissions: write-all | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Extract tag name | |
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Echo build progress | |
run: echo "Kazumi_macos_${{ env.tag }}.dmg build progress" | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version-file: pubspec.yaml | |
- run: flutter pub get | |
- run: flutter build macos --release | |
- name: Create DMG | |
run: hdiutil create -format UDZO -srcfolder build/macos/Build/Products/Release/kazumi.app -volname kazumi Kazumi_macos_${{ env.tag }}.dmg | |
- name: Upload MacOS build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos_outputs | |
path: Kazumi_macos_*.dmg | |
release: | |
name: "Release" | |
runs-on: "ubuntu-latest" | |
needs: [flutter-build-windows, flutter-build-android, flutter-build-ios, flutter-build-linux, flutter-build-macos] | |
permissions: write-all | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Extract tag name | |
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
shell: bash | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Setup Android build tools | |
run: sdkmanager "build-tools;34.0.0" | |
- name: Download windows build file | |
uses: actions/download-artifact@v4 | |
with: | |
name: windows_outputs | |
path: windows_outputs | |
- name: List files in windows_outputs directory | |
run: ls -l windows_outputs | |
- name: Copy windows build file to root | |
run: cp windows_outputs/* Kazumi_windows_${{ env.tag }}.zip | |
- name: Download android build file | |
uses: actions/download-artifact@v4 | |
with: | |
name: android_outputs | |
path: android_outputs | |
- name: List files in android_outputs directory | |
run: ls -l android_outputs | |
- name: Copy android build file to unsigned floder | |
run: | | |
mkdir build | |
mkdir build/unsigned | |
mkdir build/signed | |
cp android_outputs/* build/unsigned/Kazumi_android_${{ env.tag }}.apk | |
- name: Download iOS build file | |
uses: actions/download-artifact@v4 | |
with: | |
name: ios_outputs | |
path: ios_outputs | |
- name: List files in ios_outputs directory | |
run: ls -l ios_outputs | |
- name: Copy ios build file to root | |
run: cp ios_outputs/* Kazumi_ios_${{ env.tag }}_no_sign.ipa | |
- name: Download macos build file | |
uses: actions/download-artifact@v4 | |
with: | |
name: macos_outputs | |
path: macos_outputs | |
- name: List files in macos_outputs directory | |
run: ls -l macos_outputs | |
- name: Copy macos build file to root | |
run: cp macos_outputs/* Kazumi_macos_${{ env.tag }}.dmg | |
- name: Download linux build file | |
uses: actions/download-artifact@v4 | |
with: | |
name: linux_outputs | |
path: linux_outputs | |
- name: List files in linux_outputs directory | |
run: ls -l linux_outputs | |
- name: Copy linux build file to root | |
run: cp linux_outputs/* . | |
- name: Sign APK | |
id: sign_app | |
uses: filippoLeporati93/android-release-signer@v1 | |
with: | |
releaseDirectory: build/unsigned | |
signingKeyBase64: ${{ secrets.SIGNING_KEY_BASE64 }} | |
alias: ${{ secrets.KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: "34.0.0" | |
- name: Copy Signed android build file | |
run: cp ${{steps.sign_app.outputs.signedReleaseFile}} build/signed/Kazumi_android_${{ env.tag }}.apk | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
build/signed/*.apk | |
Kazumi_windows_*.zip | |
Kazumi_macos_*.dmg | |
Kazumi_ios_*.ipa | |
Kazumi_linux_*.tar.gz | |
Kazumi_linux_*.deb |