name: Build and Release Packages on: push: branches: [ "master" ] jobs: build-windows: runs-on: windows-latest outputs: artifact-path: ${{ steps.upload.outputs.artifact-path }} steps: - name: Checkout repository uses: actions/checkout@v6 - name: Install NSIS run: choco install nsis --no-progress -y - name: Setup MSVC uses: microsoft/setup-msbuild@v2 - name: Configure project run: cmake -B build -S . -A x64 - name: Build project run: cmake --build build --config Release - name: Generate NSIS installer run: cd build && cpack -G NSIS - name: Upload installer id: upload uses: actions/upload-artifact@v6 with: name: windows-installer path: build/*.exe build-ubuntu: runs-on: ubuntu-latest outputs: artifact-path: ${{ steps.upload.outputs.artifact-path }} steps: - name: Checkout repository uses: actions/checkout@v6 - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y cmake build-essential git \ libglfw3-dev libfreetype6-dev libfontconfig1-dev \ libx11-dev libxrandr-dev libxi-dev \ mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev \ libxinerama-dev libxcursor-dev libxkbcommon-dev - name: Configure CMake run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_GLFW=OFF - name: Build run: cmake --build build --config Release - name: Package DEB run: cd build && cpack -G DEB - name: Upload DEB id: upload uses: actions/upload-artifact@v6 with: name: deb-package path: build/*.deb build-fedora: runs-on: ubuntu-latest container: image: fedora:latest outputs: artifact-path: ${{ steps.upload.outputs.artifact-path }} steps: - name: Checkout repository uses: actions/checkout@v6 - name: Install dependencies run: | dnf install -y cmake gcc gcc-c++ make rpm-build git \ glfw-devel freetype-devel fontconfig-devel \ libX11-devel libXrandr-devel libXi-devel \ mesa-libGL-devel mesa-libGLU-devel \ libXinerama-devel libXcursor-devel \ wayland-devel wayland-protocols-devel - name: Configure CMake run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_GLFW=ON - name: Build run: cmake --build build --config Release - name: Package RPM run: cd build && cpack -G RPM - name: Upload RPM id: upload uses: actions/upload-artifact@v6 with: name: rpm-package path: build/*.rpm release: needs: [build-windows, build-ubuntu, build-fedora] runs-on: ubuntu-latest steps: - name: Download Windows artifact uses: actions/download-artifact@v6 with: name: windows-installer path: artifacts/ - name: Download DEB artifact uses: actions/download-artifact@v6 with: name: deb-package path: artifacts/ - name: Download RPM artifact uses: actions/download-artifact@v6 with: name: rpm-package path: artifacts/ - name: Create GitHub Release id: create_release uses: actions/create-release@v1 with: tag_name: v${{ github.run_number }} release_name: Release ${{ github.run_number }} draft: false prerelease: false generate_release_notes: true token: ${{ secrets.GITHUB_TOKEN }} - name: Upload Windows installer to release uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: artifacts/*.exe asset_name: clrsync-windows.exe asset_content_type: application/octet-stream - name: Upload DEB to release uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: artifacts/*.deb asset_name: clrsync-linux.deb asset_content_type: application/octet-stream - name: Upload RPM to release uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: artifacts/*.rpm asset_name: clrsync-linux.rpm asset_content_type: application/octet-stream