fixup sound #61
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| branches: [master] | |
| tags: ['*'] | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: | |
| env: | |
| BUILD_TYPE: RelWithDebInfo | |
| BUILD_OFFSET: 3623 # continue from AppVeyor build numbers | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| semver: ${{ steps.version.outputs.semver }} | |
| steps: | |
| - id: version | |
| run: | | |
| echo "version=OpenGothic v1.0.$((GITHUB_RUN_NUMBER + BUILD_OFFSET))" >> $GITHUB_OUTPUT | |
| echo "semver=1.0.$((GITHUB_RUN_NUMBER + BUILD_OFFSET))" >> $GITHUB_OUTPUT | |
| linux: | |
| needs: setup | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y glslang-tools libvulkan-dev libasound2-dev libx11-dev libxcursor-dev | |
| - name: Generate build version | |
| run: | | |
| echo '#pragma once' > game/build.h | |
| echo "static const char* appBuild = \"${{ needs.setup.outputs.version }}\";" >> game/build.h | |
| - name: Configure | |
| run: cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} | |
| - name: Build | |
| run: cmake --build build --target Gothic2Notr -j $(nproc) | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: opengothic_${{ needs.setup.outputs.semver }}_linux_x64 | |
| path: build/opengothic/Gothic2Notr | |
| linux-deb: | |
| needs: setup | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential devscripts debhelper cmake g++ \ | |
| glslang-tools libvulkan-dev libasound2-dev libx11-dev libxcursor-dev | |
| - name: Generate build version | |
| run: | | |
| echo '#pragma once' > game/build.h | |
| echo "static const char* appBuild = \"${{ needs.setup.outputs.version }}\";" >> game/build.h | |
| dch -v "${{ needs.setup.outputs.semver }}" -D unstable -M "Automated build" | |
| - name: Build Debian package | |
| run: | | |
| dpkg-buildpackage -us -uc -b | |
| cp ../opengothic_*.deb opengothic_${{ needs.setup.outputs.semver }}_linux_x64.deb | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: opengothic_${{ needs.setup.outputs.semver }}_linux_x64.deb | |
| path: opengothic_${{ needs.setup.outputs.semver }}_linux_x64.deb | |
| windows: | |
| needs: setup | |
| runs-on: windows-2025 | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| update: true | |
| install: >- | |
| mingw-w64-x86_64-gcc | |
| mingw-w64-x86_64-cmake | |
| mingw-w64-x86_64-ninja | |
| mingw-w64-x86_64-glslang | |
| mingw-w64-x86_64-vulkan-devel | |
| - name: Generate build version | |
| shell: pwsh | |
| run: | | |
| echo '#pragma once' > game/build.h | |
| echo "static const char* appBuild = `"${{ needs.setup.outputs.version }}`";" >> game/build.h | |
| - name: Configure | |
| run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} | |
| - name: Build | |
| run: cmake --build build --target Gothic2Notr | |
| - name: Copy runtime DLLs | |
| run: | | |
| cp "$MINGW_PREFIX/bin/libgcc_s_seh-1.dll" build/opengothic/ | |
| cp "$MINGW_PREFIX/bin/libstdc++-6.dll" build/opengothic/ | |
| cp "$MINGW_PREFIX/bin/libwinpthread-1.dll" build/opengothic/ | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: opengothic_${{ needs.setup.outputs.semver }}_win_x64 | |
| path: | | |
| build/opengothic/*.exe | |
| build/opengothic/*.dll | |
| build/opengothic/*.bat | |
| macos-arm64: | |
| needs: setup | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: brew install glslang molten-vk | |
| - name: Generate build version | |
| run: | | |
| echo '#pragma once' > game/build.h | |
| echo "static const char* appBuild = \"${{ needs.setup.outputs.version }}\";" >> game/build.h | |
| - name: Configure | |
| run: cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} | |
| - name: Build | |
| run: cmake --build build --target Gothic2Notr -j $(sysctl -n hw.ncpu) | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: opengothic_${{ needs.setup.outputs.semver }}_osx_arm64 | |
| path: | | |
| build/opengothic/Gothic2Notr | |
| macos-x64: | |
| needs: setup | |
| runs-on: macos-15-intel | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: brew install glslang molten-vk | |
| - name: Generate build version | |
| run: | | |
| echo '#pragma once' > game/build.h | |
| echo "static const char* appBuild = \"${{ needs.setup.outputs.version }}\";" >> game/build.h | |
| - name: Configure | |
| run: cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} | |
| - name: Build | |
| run: cmake --build build --target Gothic2Notr -j $(sysctl -n hw.ncpu) | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: opengothic_${{ needs.setup.outputs.semver }}_osx_x64 | |
| path: | | |
| build/opengothic/Gothic2Notr | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [setup, linux, linux-deb, windows, macos-arm64, macos-x64] | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Package release archives | |
| env: | |
| VERSION: ${{ needs.setup.outputs.semver }} | |
| run: | | |
| cd artifacts/opengothic_${VERSION}_linux_x64 && zip -r ../opengothic_${VERSION}_linux_x64.zip . && cd ../.. | |
| cd artifacts/opengothic_${VERSION}_win_x64 && zip -r ../opengothic_${VERSION}_win_x64.zip . && cd ../.. | |
| cd artifacts/opengothic_${VERSION}_osx_arm64 && zip -r ../opengothic_${VERSION}_osx_arm64.zip . && cd ../.. | |
| cd artifacts/opengothic_${VERSION}_osx_x64 && zip -r ../opengothic_${VERSION}_osx_x64.zip . && cd ../.. | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| prerelease: true | |
| files: | | |
| artifacts/opengothic_${{ needs.setup.outputs.semver }}_linux_x64.zip | |
| artifacts/opengothic_${{ needs.setup.outputs.semver }}_linux_x64.deb/opengothic_${{ needs.setup.outputs.semver }}_linux_x64.deb | |
| artifacts/opengothic_${{ needs.setup.outputs.semver }}_win_x64.zip | |
| artifacts/opengothic_${{ needs.setup.outputs.semver }}_osx_arm64.zip | |
| artifacts/opengothic_${{ needs.setup.outputs.semver }}_osx_x64.zip |