# Streamlity'yi derler ve paketler. # - `v*` etiketi push edilince: Windows, macOS ve Linux dosyalarıyla taslak bir # GitHub Release açar. # - Elle çalıştırılınca (Actions > Release > Run workflow): yalnız derler, dosyalar # çalıştırmanın "Artifacts" bölümüne düşer. name: Release on: push: tags: ["v*"] workflow_dispatch: permissions: contents: read env: FLUTTER_VERSION: "3.47.5" jobs: version: runs-on: ubuntu-latest outputs: version: ${{ steps.v.outputs.version }} steps: - uses: actions/checkout@v4 - id: v name: Sürümü pubspec'ten oku, etiketle karşılaştır run: | v=$(grep '^version:' pubspec.yaml | sed 's/version: *//; s/+.*//') if [[ "$GITHUB_REF_TYPE" == "tag" && "${GITHUB_REF_NAME#v}" != "$v" ]]; then echo "::error::Etiket $GITHUB_REF_NAME, pubspec sürümü $v ile uyuşmuyor" exit 1 fi echo "version=$v" >> "$GITHUB_OUTPUT" windows: needs: version runs-on: windows-latest env: VERSION: ${{ needs.version.outputs.version }} steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: channel: stable flutter-version: ${{ env.FLUTTER_VERSION }} cache: true - run: flutter pub get - run: flutter test - run: flutter build windows --release - name: VC++ çalışma zamanını pakete ekle shell: pwsh run: | $dst = "build\windows\x64\runner\Release" foreach ($f in 'msvcp140.dll', 'vcruntime140.dll', 'vcruntime140_1.dll') { Copy-Item "$env:WINDIR\System32\$f" $dst } - name: Zip shell: pwsh run: | New-Item -ItemType Directory dist -Force | Out-Null Compress-Archive -Path build\windows\x64\runner\Release\* ` -DestinationPath "dist\Streamlity-$env:VERSION-windows-x64.zip" - name: Kurulum dosyası shell: pwsh run: | $iscc = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" # windows/installer/languages altındaki dil dosyaları bu sürümden; # makinede başka sürüm kurulu olsa da sabit sürümle derlenir. choco install innosetup --version=6.7.1 --force -y --no-progress if ($LASTEXITCODE) { exit $LASTEXITCODE } & $iscc "/DAppVersion=$env:VERSION" ` "/DSourceDir=$pwd\build\windows\x64\runner\Release" ` "/DOutputDir=$pwd\dist" windows\installer\streamlity.iss if ($LASTEXITCODE) { exit $LASTEXITCODE } - uses: actions/upload-artifact@v4 with: name: windows path: dist/* if-no-files-found: error # Microsoft Store paketi. Store imzaladığı için release'e eklenmez; # Partner Center'a yüklenmek üzere ayrı artifact olur. pubspec'teki # msix_config'de Store kimliği yoksa atlanır. - name: Microsoft Store paketi (MSIX) id: msix shell: pwsh run: | if (-not (Select-String -Path pubspec.yaml -Pattern '^\s*identity_name:\s*"?[A-Za-z0-9]')) { 'Store kimliği henüz yok, MSIX atlanıyor.' exit 0 } dart run msix:create --store --version "$env:VERSION.0" ` --output-path store --output-name "Streamlity-$env:VERSION-store" if ($LASTEXITCODE) { exit $LASTEXITCODE } "built=true" >> $env:GITHUB_OUTPUT - if: steps.msix.outputs.built == 'true' uses: actions/upload-artifact@v4 with: name: microsoft-store path: store/*.msix if-no-files-found: error macos: needs: version runs-on: macos-latest env: VERSION: ${{ needs.version.outputs.version }} steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: channel: stable flutter-version: ${{ env.FLUTTER_VERSION }} cache: true - run: flutter pub get - run: flutter build macos --release - name: İmza ve mimari denetimi run: | app=build/macos/Build/Products/Release/Streamlity.app # Ad-hoc imza; Apple Silicon imzasız uygulamayı hiç açmaz. codesign --verify --deep --strict --verbose=2 "$app" lipo -info "$app/Contents/MacOS/Streamlity" - name: DMG run: | mkdir -p dist dmg cp -R build/macos/Build/Products/Release/Streamlity.app dmg/ ln -s /Applications dmg/Applications hdiutil create -volname Streamlity -srcfolder dmg \ -ov -format UDZO "dist/Streamlity-$VERSION-macos.dmg" - uses: actions/upload-artifact@v4 with: name: macos path: dist/* if-no-files-found: error linux: needs: version runs-on: ubuntu-latest env: VERSION: ${{ needs.version.outputs.version }} steps: - uses: actions/checkout@v4 - name: Sistem paketleri run: | sudo apt-get update sudo apt-get install -y clang cmake ninja-build pkg-config \ libgtk-3-dev libmpv-dev libsecret-1-dev libjsoncpp-dev - uses: subosito/flutter-action@v2 with: channel: stable flutter-version: ${{ env.FLUTTER_VERSION }} cache: true - run: flutter pub get - run: flutter build linux --release - name: Arşiv run: | mkdir -p dist tar -czf "dist/Streamlity-$VERSION-linux-x64.tar.gz" \ -C build/linux/x64/release \ --transform "s,^bundle,Streamlity-$VERSION," bundle - name: .deb run: | bash linux/packaging/build_deb.sh "$VERSION" \ build/linux/x64/release/bundle dist dpkg-deb --info dist/*.deb - uses: actions/upload-artifact@v4 with: name: linux path: dist/* if-no-files-found: error release: if: github.ref_type == 'tag' needs: [version, windows, macos, linux] runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/download-artifact@v4 with: path: dist merge-multiple: true - uses: softprops/action-gh-release@v2 with: name: Streamlity ${{ needs.version.outputs.version }} draft: true prerelease: ${{ startsWith(needs.version.outputs.version, '0.') }} generate_release_notes: true files: dist/*