Add TIM41_REGENERATE_NEWTON_TABLE option #63
This file contains 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-ignore: | |
- 'develop' | |
- 'master' | |
- 'unkotim' | |
tags: | |
- 'tim*' | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
arch: ['x86', 'x64'] | |
simd: ['sse42', 'avx', 'avx2', 'avx512'] | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: pwsh | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: timidity41 | |
fetch-depth: 0 | |
- name: Fetch tags | |
run: git fetch --tags --force | |
shell: bash | |
working-directory: timidity41 | |
- name: Run "git describe" | |
run: echo "TIM41_DESCRIBE=$(git describe --first-parent)" >> $GITHUB_ENV | |
shell: bash | |
working-directory: timidity41 | |
- name: Cache toolchain (x86) | |
id: cache-toolchain-mingw32 | |
if: ${{ matrix.arch == 'x86' }} | |
uses: actions/cache@v4 | |
with: | |
path: mingw32 | |
key: v2024-04-10/gcc-13.2.0_i686-win32-dwarf-ucrt | |
- name: Install toolchain (x86) | |
if: ${{ matrix.arch == 'x86' && steps.cache-toolchain-mingw32.outputs.cache-hit != 'true' }} | |
run: | | |
curl.exe -L -O https://github.com/starg2/mingw64-builds-GHA/releases/download/v2024-04-10/gcc-13.2.0_i686-win32-dwarf-ucrt.zip | |
7z e gcc-13.2.0_i686-win32-dwarf-ucrt.zip i686-13.2.0-release-win32-dwarf-ucrt-rt_v12.7z | |
7z x i686-13.2.0-release-win32-dwarf-ucrt-rt_v12.7z | |
- name: Cache toolchain (x64) | |
id: cache-toolchain-mingw64 | |
if: ${{ matrix.arch == 'x64' }} | |
uses: actions/cache@v4 | |
with: | |
path: mingw64 | |
key: v2024-04-10/gcc-13.2.0_x86_64-win32-seh-ucrt | |
- name: Install toolchain (x64) | |
if: ${{ matrix.arch == 'x64' && steps.cache-toolchain-mingw64.outputs.cache-hit != 'true' }} | |
run: | | |
curl.exe -L -O https://github.com/starg2/mingw64-builds-GHA/releases/download/v2024-04-10/gcc-13.2.0_x86_64-win32-seh-ucrt.zip | |
7z e gcc-13.2.0_x86_64-win32-seh-ucrt.zip x86_64-13.2.0-release-win32-seh-ucrt-rt_v12.7z | |
7z x x86_64-13.2.0-release-win32-seh-ucrt-rt_v12.7z | |
- name: Set Toolchain Path | |
run: | | |
"TOOLCHAINDIR=$($env:GITHUB_WORKSPACE -replace '\\', '/')/$(if ('${{ matrix.arch }}' -eq 'x86') { 'mingw32' } else { 'mingw64' })" >> $env:GITHUB_ENV | |
"TOOLCHAINDIR_W=$env:GITHUB_WORKSPACE\$(if ('${{ matrix.arch }}' -eq 'x86') { 'mingw32' } else { 'mingw64' })" >> $env:GITHUB_ENV | |
- name: Add PATH | |
run: | | |
$vsdir = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath | |
"$vsdir\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin" >> $env:GITHUB_PATH | |
"$vsdir\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja" >> $env:GITHUB_PATH | |
"$env:TOOLCHAINDIR_W\bin" >> $env:GITHUB_PATH | |
- name: Configure | |
run: >- | |
cmake | |
-G Ninja | |
-DCMAKE_C_COMPILER="$env:TOOLCHAINDIR/bin/gcc.exe" | |
-DCMAKE_CXX_COMPILER="$env:TOOLCHAINDIR/bin/g++.exe" | |
-DCMAKE_BUILD_TYPE=Release | |
-DCMAKE_INSTALL_PREFIX="$($env:GITHUB_WORKSPACE -replace '\\', '/')/timidity41/inst" | |
-DTIM41_X86_SIMD_LEVEL="$('${{ matrix.simd }}'.ToUpperInvariant())" | |
-S timidity41 | |
-B timidity41/build | |
- name: Build | |
run: ninja -C timidity41\build | |
- name: Install | |
run: ninja -C timidity41\build install | |
- name: Install runtime DLLs | |
run: >- | |
robocopy | |
"$env:TOOLCHAINDIR_W\bin" | |
timidity41\inst\bin | |
libgcc_s*.dll libstdc++*.dll | |
; if ($LASTEXITCODE -le 1) { $LASTEXITCODE = 0 } | |
- name: Create release archive | |
run: | | |
robocopy timidity41\inst "$env:TIM41_DESCRIBE-${{ matrix.arch }}-${{ matrix.simd }}" /E /XD lib; if ($LASTEXITCODE -le 1) { $LASTEXITCODE = 0 } | |
robocopy "$env:TOOLCHAINDIR_W\licenses\mingw-w64" "$env:TIM41_DESCRIBE-${{ matrix.arch }}-${{ matrix.simd }}" COPYING.MinGW-w64-runtime.txt; if ($LASTEXITCODE -le 1) { $LASTEXITCODE = 0 } | |
7z a "$env:TIM41_DESCRIBE-${{ matrix.arch }}-${{ matrix.simd }}.zip" "$env:TIM41_DESCRIBE-${{ matrix.arch }}-${{ matrix.simd }}" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: timidity41-${{ matrix.arch }}-${{ matrix.simd }} | |
path: ${{ env.TIM41_DESCRIBE }}-${{ matrix.arch }}-${{ matrix.simd }}.zip | |
release: | |
if: ${{ startsWith(github.ref, 'refs/tags/tim41') }} | |
needs: build | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: artifact | |
- name: Move artifacts | |
run: mv artifact/timidity41-*/*.zip . | |
- name: Generate release name | |
run: echo "RELEASE_NAME=$GITHUB_REF_NAME" | sed 's/tim/TiMidity++ 41 version /' >> $GITHUB_ENV | |
- uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ env.RELEASE_NAME }} | |
files: '*.zip' | |
draft: true |