Skip to content

Flutter Build and Release #2

Flutter Build and Release

Flutter Build and Release #2

Workflow file for this run

name: Cross-Platform Build and Release
on:
release:
types: [published] # Taslak halindeki release yayınlandığında tetiklenir
permissions:
contents: write
jobs:
release:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
PYTHONUTF8: 1
strategy:
fail-fast: false # Bir platform hata verirse diğerlerini durdurma
matrix:
include:
- os: windows-latest
artifact_name: Windows
- os: ubuntu-20.04 # Daha eski sistemlerle uyumluluk için 20.04
artifact_name: Linux
- os: macos-13 # Intel/Apple Silicon uyumluluğu için macos-13
artifact_name: MacOS
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip' # Bağımlılıkları önbelleğe alarak hızlandırır
- name: Install System Dependencies (Linux Only)
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libegl1-mesa \
libxcb-xinerama0 \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-shape0 \
libxcb-xfixes0 \
libasound2 \
zip
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Run Build Script
run: python installers/build.py
# --- ARŞİVLEME ---
- name: Archive Windows Artifact
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Compress-Archive -Path dist/DungeonMasterTool -DestinationPath DungeonMasterTool-Windows.zip
- name: Archive Linux Artifact
if: matrix.os == 'ubuntu-20.04'
run: |
zip -r DungeonMasterTool-Linux.zip dist/DungeonMasterTool
- name: Archive MacOS Artifact
if: matrix.os == 'macos-13'
run: |
zip -r DungeonMasterTool-MacOS.zip dist/DungeonMasterTool
# --- RELEASE'E EKLEME ---
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
# Mevcut release'e dosyaları ekler
files: DungeonMasterTool-${{ matrix.artifact_name }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}