name: Build and Release on: push: tags: - 'v*' workflow_dispatch: permissions: contents: write jobs: build-windows: name: Build Windows x64 runs-on: windows-2022 steps: - name: Checkout Code uses: actions/checkout@v4 - name: Setup Flutter uses: subosito/flutter-action@v2 with: channel: 'stable' cache: true - name: Enable Windows Desktop run: flutter config --enable-windows-desktop - name: Install Dependencies run: flutter pub get - name: Build Windows Release run: flutter build windows --release - name: Package Windows Zip shell: pwsh run: | $tag = "${{ github.ref_name }}" if (-not $tag) { $tag = "v3.4.1" } $zipName = "Prisma-$tag-windows-x64.zip" Compress-Archive -Path "build\windows\x64\runner\Release\*" -DestinationPath $zipName echo "ZIP_NAME=$zipName" >> $env:GITHUB_ENV - name: Upload Windows Artifact uses: actions/upload-artifact@v4 with: name: Prisma-windows-x64 path: ${{ env.ZIP_NAME }} - name: Upload to GitHub Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: files: ${{ env.ZIP_NAME }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} build-macos: name: Build macOS runs-on: macos-latest steps: - name: Checkout Code uses: actions/checkout@v4 - name: Setup Flutter uses: subosito/flutter-action@v2 with: channel: 'stable' cache: true - name: Enable macOS Desktop run: flutter config --enable-macos-desktop - name: Install Dependencies run: flutter pub get - name: Build macOS Release run: flutter build macos --release - name: Package macOS Zip run: | TAG="${{ github.ref_name }}" if [ -z "$TAG" ]; then TAG="v3.4.1"; fi ZIP_NAME="Prisma-$TAG-macos.zip" cd build/macos/Build/Products/Release zip -r -y "$GITHUB_WORKSPACE/$ZIP_NAME" Prisma.app echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV - name: Upload macOS Artifact uses: actions/upload-artifact@v4 with: name: Prisma-macos path: ${{ env.ZIP_NAME }} - name: Upload to GitHub Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: files: ${{ env.ZIP_NAME }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}