diff --git a/.github/workflows/Tagged.yaml b/.github/workflows/Tagged.yaml new file mode 100644 index 0000000..1f4f61a --- /dev/null +++ b/.github/workflows/Tagged.yaml @@ -0,0 +1,132 @@ +name: Tagged build + +on: + push: + tags: + - '*.*.*' + paths-ignore: + - '.github/workflows/Untagged.yaml' + +env: + Configuration: Release + +permissions: + id-token: "write" + contents: "write" + packages: "write" + +jobs: + Build: + name: ${{matrix.config.name}} + runs-on: windows-latest + strategy: + matrix: + config: + - { + name: "Win32", + platform: "Win32" + } + - { + name: "Win64", + platform: "x64" + } + steps: + + - name: Checkout repository + uses: actions/checkout@v3.0.0 + + - name: Clone latest OpenAL Soft commit + run: | + "DSOALCommitTag=$(git describe --tags)" >> $env:GITHUB_ENV + git clone https://github.com/kcat/openal-soft.git + cd "openal-soft" + "OpenALSoftCommitTag=$(git describe --tags --abbrev=0 --match *.*.*)" >> $env:GITHUB_ENV + cd "${{github.workspace}}" + + - name: Clone latest OpenAL Soft tag + run: | + rm openal-soft -r -force + git clone --depth 1 --branch ${{env.OpenALSoftCommitTag}} https://github.com/kcat/openal-soft.git + + - name: ${{matrix.config.name}} - Build DSOAL + run: | + cd build + cmake -A ${{matrix.config.platform}} .. + cmake --build . --config ${{env.Configuration}} --clean-first + + - name: ${{matrix.config.name}} - Build OpenAL Soft + run: | + cmake -B "${{github.workspace}}/openal-soft/build" -DCMAKE_Configuration=${{env.Configuration}} -A ${{matrix.config.platform}} -DALSOFT_BUILD_ROUTER=ON -DALSOFT_REQUIRE_WINMM=ON -DALSOFT_REQUIRE_DSOUND=ON -DALSOFT_REQUIRE_WASAPI=ON "${{github.workspace}}/openal-soft" + cmake --build "${{github.workspace}}/openal-soft/build" --config ${{env.Configuration}} + + - name: ${{matrix.config.name}} - Collect binaries + run: | + mkdir "DSOAL" + mkdir "DSOAL/Documentation" + move "${{github.workspace}}/build/${{env.Configuration}}/dsound.dll" "DSOAL/dsound.dll" + move "${{github.workspace}}/openal-soft/build/${{env.Configuration}}/soft_oal.dll" "DSOAL/dsoal-aldrv.dll" + copy "${{github.workspace}}/openal-soft/alsoftrc.sample" "DSOAL/alsoft.ini" + copy "${{github.workspace}}/README.md" "DSOAL/Documentation/DSOAL-ReadMe.txt" + copy "${{github.workspace}}/LICENSE" "DSOAL/Documentation/DSOAL-License.txt" + copy "${{github.workspace}}/openal-soft/README.md" "DSOAL/Documentation/OpenALSoft-ReadMe.txt" + copy "${{github.workspace}}/openal-soft/COPYING" "DSOAL/Documentation/OpenALSoft-License.txt" + copy "${{github.workspace}}/openal-soft/BSD-3Clause" "DSOAL/Documentation/OpenALSoft-BSD-3Clause.txt" + copy "${{github.workspace}}/openal-soft/ChangeLog" "DSOAL/Documentation/OpenALSoft-ChangeLog.txt" + + - name: ${{matrix.config.name}} - Upload artifact to GitHub actions + uses: actions/upload-artifact@v3 + with: + name: DSOAL_${{env.DSOALCommitTag}}+OpenALSoft_${{env.OpenALSoftCommitTag}}-${{matrix.config.name}} + path: DSOAL/ + + outputs: + DSOALCommitTag: ${{env.DSOALCommitTag}} + OpenALSoftCommitTag: ${{env.OpenALSoftCommitTag}} + + Release: + needs: Build + runs-on: windows-latest + steps: + + - name: Download a Build Artifact + uses: actions/download-artifact@v3.0.2 + with: + path: Release + + - name: Separate binaries by architecture + run: | + MkDir "Release/DSOAL/Win32" + Copy-Item -Path "Release/DSOAL_${{needs.Build.outputs.DSOALCommitTag}}+OpenALSoft_${{needs.Build.outputs.OpenALSoftCommitTag}}-Win32/*" -Destination "Release/DSOAL/Win32" -Recurse + Move-Item "Release/DSOAL/Win32/Documentation" "Release/DSOAL" + MkDir "Release/DSOAL/Win64" + Copy-Item -Path "Release/DSOAL_${{needs.Build.outputs.DSOALCommitTag}}+OpenALSoft_${{needs.Build.outputs.OpenALSoftCommitTag}}-Win64/*" -Destination "Release/DSOAL/Win64" -Recurse + Remove-Item -LiteralPath "Release/DSOAL/Win64/Documentation" -Force -Recurse + Rename-Item "Release/DSOAL_${{needs.Build.outputs.DSOALCommitTag}}+OpenALSoft_${{needs.Build.outputs.OpenALSoftCommitTag}}-Win32" -NewName "Win32" + Rename-Item "Release/DSOAL_${{needs.Build.outputs.DSOALCommitTag}}+OpenALSoft_${{needs.Build.outputs.OpenALSoftCommitTag}}-Win64" -NewName "Win64" + + - name: Compress artifacts - Win32 + uses: vimtor/action-zip@v1.1 + with: + files: 'Release/Win32/' + dest: "Release/DSOAL_${{needs.Build.outputs.DSOALCommitTag}}+OpenALSoft_${{needs.Build.outputs.OpenALSoftCommitTag}}-Win32.zip" + + - name: Compress artifacts - Win64 + uses: vimtor/action-zip@v1.1 + with: + files: 'Release/Win64/' + dest: "Release/DSOAL_${{needs.Build.outputs.DSOALCommitTag}}+OpenALSoft_${{needs.Build.outputs.OpenALSoftCommitTag}}-Win64.zip" + + - name: Compress artifacts + uses: vimtor/action-zip@v1.1 + with: + files: 'Release/DSOAL/' + dest: "Release/DSOAL.zip" + + - name: GitHub pre-release + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{secrets.GITHUB_TOKEN}}" + automatic_release_tag: "${{needs.Build.outputs.DSOALCommitTag}}" + prerelease: false + title: "DSOAL ${{needs.Build.outputs.DSOALCommitTag}} + OpenAL Soft ${{needs.Build.outputs.OpenALSoftCommitTag}}" + files: "Release/*" \ No newline at end of file diff --git a/.github/workflows/Untagged.yaml b/.github/workflows/Untagged.yaml new file mode 100644 index 0000000..c6bcda6 --- /dev/null +++ b/.github/workflows/Untagged.yaml @@ -0,0 +1,142 @@ +name: Untagged build + +on: + push: + branches: + - 'c++-rewrite' + tags-ignore: + - '*.*.*' + paths-ignore: + - '.github/workflows/Tagged.yaml' + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +env: + Configuration: Release + +permissions: + id-token: "write" + contents: "write" + packages: "write" + +jobs: + Build: + name: ${{matrix.config.name}} + runs-on: windows-latest + strategy: + matrix: + config: + - { + name: "Win32", + platform: "Win32" + } + - { + name: "Win64", + platform: "x64" + } + steps: + + - name: Clone DSOAL + run: git clone https://github.com/kcat/dsoal.git . + + - name: Clone OpenAL Soft + run: git clone https://github.com/kcat/openal-soft.git + + - name: Get current date + run: echo "CurrentDate=$(date +'%Y-%m-%d')" >> $env:GITHUB_ENV + + - name: Get commit hash and count + run: | + echo "DSOALCommitHashShort=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV + echo "DSOALCommitCount=$(git rev-list --count master)" >> $env:GITHUB_ENV + cd "openal-soft" + echo "OpenALSoftCommitHashShort=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV + echo "OpenALSoftCommitCount=$(git rev-list --count master)" >> $env:GITHUB_ENV + cd "${{github.workspace}}" + + - name: ${{matrix.config.name}} - Build DSOAL + run: | + cd build + cmake -A ${{matrix.config.platform}} .. + cmake --build . --config ${{env.Configuration}} --clean-first + + - name: ${{matrix.config.name}} - Build OpenAL Soft + run: | + cmake -B "${{github.workspace}}/openal-soft/build" -DCMAKE_Configuration=${{env.Configuration}} -A ${{matrix.config.platform}} -DALSOFT_BUILD_ROUTER=ON -DALSOFT_REQUIRE_WINMM=ON -DALSOFT_REQUIRE_DSOUND=ON -DALSOFT_REQUIRE_WASAPI=ON "${{github.workspace}}/openal-soft" + cmake --build "${{github.workspace}}/openal-soft/build" --config ${{env.Configuration}} + + - name: ${{matrix.config.name}} - Collect binaries + run: | + mkdir "DSOAL" + mkdir "DSOAL/Documentation" + move "${{github.workspace}}/build/${{env.Configuration}}/dsound.dll" "DSOAL/dsound.dll" + move "${{github.workspace}}/openal-soft/build/${{env.Configuration}}/soft_oal.dll" "DSOAL/dsoal-aldrv.dll" + copy "${{github.workspace}}/openal-soft/alsoftrc.sample" "DSOAL/alsoft.ini" + copy "${{github.workspace}}/README.md" "DSOAL/Documentation/DSOAL-ReadMe.txt" + copy "${{github.workspace}}/LICENSE" "DSOAL/Documentation/DSOAL-License.txt" + copy "${{github.workspace}}/openal-soft/README.md" "DSOAL/Documentation/OpenALSoft-ReadMe.txt" + copy "${{github.workspace}}/openal-soft/COPYING" "DSOAL/Documentation/OpenALSoft-License.txt" + copy "${{github.workspace}}/openal-soft/BSD-3Clause" "DSOAL/Documentation/OpenALSoft-BSD-3Clause.txt" + copy "${{github.workspace}}/openal-soft/ChangeLog" "DSOAL/Documentation/OpenALSoft-ChangeLog.txt" + + - name: ${{matrix.config.name}} - Upload artifact to GitHub actions + uses: actions/upload-artifact@v3 + with: + name: ${{env.CurrentDate}}_DSOAL_r${{env.DSOALCommitCount}}@${{env.DSOALCommitHashShort}}+OpenALSoft_r${{env.OpenALSoftCommitCount}}@${{env.OpenALSoftCommitHashShort}}-${{matrix.config.name}} + path: DSOAL/ + + outputs: + CurrentDate: ${{env.CurrentDate}} + DSOALCommitHashShort: ${{env.DSOALCommitHashShort}} + DSOALCommitCount: ${{env.DSOALCommitCount}} + OpenALSoftCommitHashShort: ${{env.OpenALSoftCommitHashShort}} + OpenALSoftCommitCount: ${{env.OpenALSoftCommitCount}} + + Release: + needs: Build + runs-on: windows-latest + steps: + + - name: Download a Build Artifact + uses: actions/download-artifact@v3.0.2 + with: + path: Release + + - name: Separate binaries by architecture + run: | + MkDir "Release/DSOAL/Win32" + Copy-Item -Path "Release/${{needs.Build.outputs.CurrentDate}}_DSOAL_r${{needs.Build.outputs.DSOALCommitCount}}@${{needs.Build.outputs.DSOALCommitHashShort}}+OpenALSoft_r${{needs.Build.outputs.OpenALSoftCommitCount}}@${{needs.Build.outputs.OpenALSoftCommitHashShort}}-Win32/*" -Destination "Release/DSOAL/Win32" -Recurse + Move-Item "Release/DSOAL/Win32/Documentation" "Release/DSOAL" + MkDir "Release/DSOAL/Win64" + Copy-Item -Path "Release/${{needs.Build.outputs.CurrentDate}}_DSOAL_r${{needs.Build.outputs.DSOALCommitCount}}@${{needs.Build.outputs.DSOALCommitHashShort}}+OpenALSoft_r${{needs.Build.outputs.OpenALSoftCommitCount}}@${{needs.Build.outputs.OpenALSoftCommitHashShort}}-Win64/*" -Destination "Release/DSOAL/Win64" -Recurse + Remove-Item -LiteralPath "Release/DSOAL/Win64/Documentation" -Force -Recurse + Rename-Item "Release/${{needs.Build.outputs.CurrentDate}}_DSOAL_r${{needs.Build.outputs.DSOALCommitCount}}@${{needs.Build.outputs.DSOALCommitHashShort}}+OpenALSoft_r${{needs.Build.outputs.OpenALSoftCommitCount}}@${{needs.Build.outputs.OpenALSoftCommitHashShort}}-Win32" -NewName "Win32" + Rename-Item "Release/${{needs.Build.outputs.CurrentDate}}_DSOAL_r${{needs.Build.outputs.DSOALCommitCount}}@${{needs.Build.outputs.DSOALCommitHashShort}}+OpenALSoft_r${{needs.Build.outputs.OpenALSoftCommitCount}}@${{needs.Build.outputs.OpenALSoftCommitHashShort}}-Win64" -NewName "Win64" + + - name: Compress artifacts - Win32 + uses: vimtor/action-zip@v1.1 + with: + files: 'Release/Win32/' + dest: "Release/${{needs.Build.outputs.CurrentDate}}_DSOAL_r${{needs.Build.outputs.DSOALCommitCount}}@${{needs.Build.outputs.DSOALCommitHashShort}}+OpenALSoft_r${{needs.Build.outputs.OpenALSoftCommitCount}}@${{needs.Build.outputs.OpenALSoftCommitHashShort}}-Win32.zip" + + - name: Compress artifacts - Win64 + uses: vimtor/action-zip@v1.1 + with: + files: 'Release/Win64/' + dest: "Release/${{needs.Build.outputs.CurrentDate}}_DSOAL_r${{needs.Build.outputs.DSOALCommitCount}}@${{needs.Build.outputs.DSOALCommitHashShort}}+OpenALSoft_r${{needs.Build.outputs.OpenALSoftCommitCount}}@${{needs.Build.outputs.OpenALSoftCommitHashShort}}-Win64.zip" + + - name: Compress artifacts + uses: vimtor/action-zip@v1.1 + with: + files: 'Release/DSOAL/' + dest: "Release/DSOAL.zip" + + - name: GitHub pre-release + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{secrets.GITHUB_TOKEN}}" + automatic_release_tag: "latest" + prerelease: true + title: "[${{needs.Build.outputs.CurrentDate}}] DSOAL r${{needs.Build.outputs.DSOALCommitCount}}@${{needs.Build.outputs.DSOALCommitHashShort}} + OpenAL Soft r${{needs.Build.outputs.OpenALSoftCommitCount}}@${{needs.Build.outputs.OpenALSoftCommitHashShort}}" + files: "Release/*" \ No newline at end of file diff --git a/.github/workflows/default-ci.yaml b/.github/workflows/default-ci.yaml deleted file mode 100644 index f12399f..0000000 --- a/.github/workflows/default-ci.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: CMake Build - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - -jobs: - build: - runs-on: windows-latest - strategy: - matrix: - arch: [Win32, x64] - - steps: - - uses: actions/checkout@v2 - - - name: Configure CMake - # Configure CMake in the 'build' subdirectory. - run: cmake -B ${{github.workspace}}/build -A ${{matrix.arch}} - - - name: Build - # Build the library with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Create Archive - working-directory: ${{github.workspace}}/build - # Create package defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/module/CPack.html for more detail - run: cpack - - - name: Upload Archive - # Upload package as an artifact of this workflow. - uses: actions/upload-artifact@v2 - with: - name: dsoal-${{matrix.arch}} - path: ${{github.workspace}}/build/packages/*