diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 0000000..a5bb994 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,169 @@ +name: Build and Release DeckTX + +on: + push: + branches: [ "main" ] + tags: [ '*' ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build-windows: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up CMake + uses: lukka/get-cmake@v3.27.1 + + - name: Set environment variables + id: strings + run: | + echo "build-dir=${{ github.workspace }}/build" >> "$env:GITHUB_ENV" + echo "install-dir=${{ github.workspace }}/install" >> "$env:GITHUB_ENV" + + - name: Configure CMake + run: cmake -B ${{ env.build-dir }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ env.install-dir }} -S ${{ github.workspace }} + + - name: Build + run: cmake --build ${{ env.build-dir }} --config Release --target install + + - name: Package build artifacts + uses: actions/upload-artifact@v3 + with: + name: DeckTX-Windows + path: ${{ env.install-dir }} + + build-linux: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up Flatpak + run: | + sudo apt update + sudo apt install -y flatpak flatpak-builder + + - name: Add Flathub Remote + run: | + sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + + - name: Set environment variables + id: strings + run: | + echo "build-dir=${{ github.workspace }}/build" >> "$GITHUB_ENV" + echo "flatpak-json=${{ github.workspace }}/flatpak.json" >> "$GITHUB_ENV" + echo "flatpak-file=${{ github.workspace }}/decktx.flatpak" >> "$GITHUB_ENV" + + - name: Allow file protocol in Git + run: git config --global protocol.file.allow always + + - name: Generate Flatpak manifest + run: | + cat > ${{ env.flatpak-json }} <