Release #1
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 | |
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 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.16.0' | |
channel: 'stable' | |
cache: false # Disabled cuz windows is bad | |
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: Zip File | |
run: Compress-Archive -Path build\windows\x64\runner\Release* -Destination build.zip | |
- name: Upload Release Asset | |
id: 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.zip | |
asset_name: Stronzflix Windows - amd64.zip | |
asset_content_type: application/zip | |
build_linux: | |
name: Build Linux | |
needs: create_release | |
runs-on: ubuntu-latest | |
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 | |
- name: Download Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.16.0' | |
channel: 'stable' | |
cache: true | |
cache-key: 'flutter-linux' | |
cache-path: '${{ runner.tool_cache }}/flutter/linux' | |
architecture: x64 | |
- name: Build Linux App | |
run: | | |
flutter config --enable-linux-desktop | |
flutter build linux --release | |
- name: Zip File | |
run: | | |
cd build/linux/x64/release; zip -r ../../../../build.zip bundle; cd - | |
- name: Upload Release Asset | |
id: 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.zip | |
asset_name: Stronzflix Linux - amd64.zip | |
asset_content_type: application/zip | |
build_android: | |
name: Build Android | |
needs: create_release | |
runs-on: ubuntu-latest | |
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.16.0' | |
channel: 'stable' | |
cache: true | |
cache-key: 'flutter-android' | |
cache-path: '${{ runner.tool_cache }}/flutter/android' | |
architecture: x64 | |
- name: Build Android App | |
run: | | |
flutter config --enable-android | |
flutter build apk --release | |
- name: Upload Release Asset | |
id: 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 |