name: Build and Release on: push: tags: - 'v*' jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] include: - os: ubuntu-latest artifact_name: server-shuttle-linux asset_name: server-shuttle-linux.zip executable_path: dist/server-shuttle - os: windows-latest artifact_name: server-shuttle-windows asset_name: server-shuttle-windows.zip executable_path: dist/server-shuttle.exe - os: macos-latest artifact_name: server-shuttle-macos asset_name: server-shuttle-macos.zip executable_path: dist/server-shuttle steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install pyinstaller Pillow - name: Convert Icon to ICO (Windows) if: matrix.os == 'windows-latest' shell: python run: | from PIL import Image img = Image.open('server-shuttle-icon.png') img.save('server-shuttle-icon.ico', format='ICO', sizes=[(256, 256)]) - name: Build with PyInstaller run: | echo "Listing directory contents:" ls -R || dir /s pyinstaller server-shuttle.spec - name: Prepare Release Asset (Linux/MacOS) if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' run: | cp ${{ matrix.executable_path }} server-shuttle chmod +x server-shuttle zip ${{ matrix.asset_name }} server-shuttle - name: Prepare Release Asset (Windows) if: matrix.os == 'windows-latest' run: | copy ${{ matrix.executable_path }} server-shuttle.exe powershell Compress-Archive -Path "server-shuttle.exe" -DestinationPath "${{ matrix.asset_name }}" - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact_name }} path: ${{ matrix.asset_name }} release: needs: build runs-on: ubuntu-latest permissions: contents: write steps: - name: Download Artifacts uses: actions/download-artifact@v4 with: path: artifacts - name: Create Release uses: softprops/action-gh-release@v2 with: files: | artifacts/server-shuttle-linux/server-shuttle-linux.zip artifacts/server-shuttle-windows/server-shuttle-windows.zip artifacts/server-shuttle-macos/server-shuttle-macos.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}