Release #93
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: | |
workflow_dispatch: | |
inputs: | |
build_windows: | |
description: 'Build for Windows' | |
type: boolean | |
required: true | |
default: true | |
build_linux: | |
description: 'Build for Linux' | |
type: boolean | |
required: true | |
default: true | |
build_macos: | |
description: 'Build for MacOS' | |
type: boolean | |
required: true | |
default: true | |
build_android: | |
description: 'Build for Android' | |
type: boolean | |
required: true | |
default: true | |
jobs: | |
create_release: | |
name: Create Draft Release | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release_id.outputs.upload_url }} | |
steps: | |
- name: Create Draft Release | |
id: create_release_id | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: auto-generated draft | |
release_name: Auto-Generated Draft | |
body: | | |
New Features: | |
- Foo | |
Fixes: | |
- Bar | |
Known Issues: | |
- Foobar | |
Authors: | |
@Bonfra04 | |
draft: true | |
prerelease: false | |
build_windows: | |
name: Build Windows | |
needs: create_release | |
runs-on: windows-latest | |
if: ${{ inputs.build_windows }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download dependencies | |
run: | | |
dotnet tool install --global wix --version 4.0.4 | |
wix extension add --global WixToolset.UI.wixext/4.0.4 | |
- name: Download Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.26.0-0.1.pre" | |
channel: "beta" | |
cache: false # windows cache is broken | |
cache-key: "flutter-windows" | |
cache-path: "${{ runner.tool_cache }}/flutter/windows" | |
architecture: x64 | |
- name: Build Windows App | |
run: | | |
flutter config --enable-windows-desktop | |
flutter build windows --release | |
- name: Pack Outputs | |
run: | | |
cd build\windows\x64 | |
cpack | |
- name: Upload Release Asset (Portable) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ./build/windows/x64/Stronzflix.7z | |
asset_name: Stronzflix Windows - amd64 (Portable).7z | |
asset_content_type: application/x-7z-compressed | |
- name: Upload Release Asset (MSI) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ./build/windows/x64/Stronzflix.msi | |
asset_name: Stronzflix.msi | |
asset_content_type: application/x-msi | |
build_linux: | |
name: Build Linux | |
needs: create_release | |
runs-on: ubuntu-latest | |
if: ${{ inputs.build_linux }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev desktop-file-utils | |
wget "https://github.com/AppImage/appimagetool/releases/download/1.9.0/appimagetool-x86_64.AppImage" -O appimagetool | |
chmod +x appimagetool | |
sudo mv appimagetool /usr/local/bin | |
- name: Download Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.26.0-0.1.pre" | |
channel: "beta" | |
cache: true | |
cache-key: "flutter-linux" | |
cache-path: "${{ runner.tool_cache }}/flutter/linux" | |
architecture: x64 | |
- name: Download ffmpeg | |
run: | | |
wget "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz" | |
tar -xf ffmpeg-master-latest-linux64-gpl.tar.xz | |
mv ffmpeg-master-latest-linux64-gpl ffmpeg | |
- name: Build Linux App | |
run: | | |
flutter config --enable-linux-desktop | |
flutter build linux --release | |
- name: Copy dependencies | |
run: | | |
cp ffmpeg/bin/ffmpeg build/linux/x64/release/bundle | |
cp ffmpeg/LICENSE.txt build/linux/x64/release/bundle/ffmpeg_LICENSE.txt | |
- name: Build AppImage | |
run: | | |
./linux/appimage/generate_appimage.sh | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ./build/linux/x64/release/Stronzflix.AppImage | |
asset_name: Stronzflix Linux - amd64.AppImage | |
asset_content_type: application/octet-stream | |
build_macos: | |
name: Build MacOS | |
needs: create_release | |
runs-on: macos-14 | |
if: ${{ inputs.build_macos }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.26.0-0.1.pre" | |
channel: "beta" | |
cache: true | |
cache-key: "flutter-macos" | |
cache-path: "${{ runner.tool_cache }}/flutter/macos" | |
- name: Build MacOS App | |
run: | | |
flutter config --enable-macos-desktop | |
flutter build macos --release | |
- name: Zip File | |
run: | | |
cd build/macos/Build/Products/Release; 7z a ../../../../../build.7z stronzflix.app; cd - | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ./build.7z | |
asset_name: Stronzflix MacOS - arm.zip | |
asset_content_type: application/x-7z-compressed | |
build_android: | |
name: Build Android | |
needs: create_release | |
runs-on: ubuntu-latest | |
if: ${{ inputs.build_android }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download dependencies | |
uses: actions/setup-java@v2 | |
with: | |
distribution: "zulu" | |
java-version: "17" | |
- name: Download Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.26.0-0.1.pre" | |
channel: "beta" | |
cache: true | |
cache-key: "flutter-android" | |
cache-path: "${{ runner.tool_cache }}/flutter/android" | |
architecture: x64 | |
- name: Build Android App | |
env: | |
KEY_JKS: ${{ secrets.KEY_JKS }} | |
KEY_PASSWORD: ${{ secrets.ALIAS_PASSWORD }} | |
ALIAS_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
run: | | |
base64 -d <<< $KEY_JKS > ./android/app/release-key.jks | |
flutter config --enable-android | |
flutter build apk --release | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: build/app/outputs/flutter-apk/app-release.apk | |
asset_name: Stronzflix.apk | |
asset_content_type: application/vnd.android.package-archive |