Create release #75
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
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| name: Create release | |
| jobs: | |
| build-linux: | |
| name: linux ${{matrix.architecture}} static | |
| container: | |
| image: ubuntu:20.04 | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| architecture: [ x64, arm64 ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Install tools | |
| run: ./.github/build/linux-${{matrix.architecture}}/install.sh | |
| - name: Clone dependencies | |
| run: ./clone-dependencies.sh | |
| - name: Build | |
| run: ./.github/build/linux-${{matrix.architecture}}/build.sh | |
| - name: Prepare artifacts | |
| run: | | |
| mkdir -p Artifacts | |
| cp -r /tmp/dependencies/lib Artifacts | |
| cp -r /tmp/dependencies/include Artifacts | |
| cd Artifacts | |
| zip -r ../linux-${{matrix.architecture}}-static.zip . | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: linux-${{matrix.architecture}}-static | |
| path: linux-${{matrix.architecture}}-static.zip | |
| build-linux-musl: | |
| name: linux musl ${{matrix.architecture}} static | |
| container: | |
| image: alpine:3.18 | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| architecture: [ x64 ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Install tools | |
| run: ./.github/build/linux-musl-${{matrix.architecture}}/install.sh | |
| - name: Clone dependencies | |
| run: ./clone-dependencies.sh | |
| - name: Build | |
| run: ./.github/build/linux-musl-${{matrix.architecture}}/build.sh | |
| - name: Prepare artifacts | |
| run: | | |
| mkdir -p Artifacts | |
| cp -r /tmp/dependencies/lib Artifacts | |
| cp -r /tmp/dependencies/lib64 Artifacts | |
| cp -r /tmp/dependencies/include Artifacts | |
| cd Artifacts | |
| zip -r ../linux-musl-${{matrix.architecture}}-static.zip . | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: linux-musl-${{matrix.architecture}}-static | |
| path: linux-musl-${{matrix.architecture}}-static.zip | |
| build-macos-x64: | |
| name: macOS x64 static | |
| runs-on: macos-15-intel | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Install tools | |
| run: ./.github/build/macos-x64/install.sh | |
| - name: Clone dependencies | |
| run: ./clone-dependencies.sh | |
| - name: Build | |
| run: ./.github/build/macos-x64/build.sh | |
| - name: Prepare artifacts | |
| run: | | |
| mkdir -p Artifacts | |
| cp -r /tmp/dependencies/lib Artifacts | |
| cp -r /tmp/dependencies/include Artifacts | |
| cd Artifacts | |
| zip -r ../macos-x64-static.zip . | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: macos-x64-static | |
| path: macos-x64-static.zip | |
| build-macos: | |
| name: macOS arm64 static | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Install tools | |
| run: ./.github/build/macos-arm64/install.sh | |
| - name: Clone dependencies | |
| run: ./clone-dependencies.sh | |
| - name: Build | |
| run: ./.github/build/macos-arm64/build.sh | |
| - name: Prepare artifacts | |
| run: | | |
| mkdir -p Artifacts | |
| cp -r /tmp/dependencies/lib Artifacts | |
| cp -r /tmp/dependencies/include Artifacts | |
| cd Artifacts | |
| zip -r ../macos-arm64-static.zip . | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: macos-arm64-static | |
| path: macos-arm64-static.zip | |
| build-wasm: | |
| name: wasm ${{matrix.architecture}} static | |
| container: | |
| image: emscripten/emsdk:4.0.7 | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| architecture: [ x86 ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Install tools | |
| run: ./.github/build/wasm-${{matrix.architecture}}/install.sh | |
| - name: Clone dependencies | |
| run: ./clone-dependencies.sh | |
| - name: Build | |
| run: ./.github/build/wasm-${{matrix.architecture}}/build.sh | |
| - name: Prepare artifacts | |
| run: | | |
| mkdir -p Artifacts | |
| cp -r /tmp/dependencies/lib Artifacts | |
| cp -r /tmp/dependencies/include Artifacts | |
| cp -r /tmp/dependencies/license Artifacts | |
| cd Artifacts | |
| zip -r ../wasm-${{matrix.architecture}}-static.zip . | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: wasm-${{matrix.architecture}}-static | |
| path: wasm-${{matrix.architecture}}-static.zip | |
| build-windows: | |
| name: windows ${{matrix.architecture}} ${{matrix.buildType}} ${{matrix.openmp}} ${{matrix.all == true && 'all' || ''}} ${{matrix.linkRuntime == true && 'linked runtime' || ''}} | |
| runs-on: windows-2022 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| architecture: [ x64, arm64, x86 ] | |
| buildType: [ dynamic, static ] | |
| openmp: [ OpenMP, noOpenMP ] | |
| all: [ false, true ] | |
| linkRuntime: [ false, true ] | |
| exclude: | |
| - buildType: dynamic | |
| linkRuntime: true | |
| - all: true | |
| linkRuntime: true | |
| env: | |
| ARTIFACT_NAME: windows-${{matrix.architecture}}-${{matrix.buildType}}-${{matrix.openmp}}${{matrix.all == true && '-all' || ''}}${{matrix.linkRuntime == true && '-linked-runtime' || ''}} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Download configure | |
| shell: cmd | |
| run: | | |
| .github\build\windows\download-configure.cmd | |
| - name: Clone dependencies | |
| shell: cmd | |
| run: clone-dependencies.cmd | |
| - name: Run configure | |
| shell: cmd | |
| working-directory: Configure | |
| run: | | |
| Configure.Release.x64.exe /noWizard /VS2022 /${{matrix.architecture}} /${{matrix.buildType}} /${{matrix.openmp}} ${{matrix.all == true && '/includeOptional /incompatibleLicense' || ''}} ${{matrix.linkRuntime == true && '/linkRuntime /includeNonWindows' || ''}} | |
| - name: Build | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" | |
| msbuild IM7.${{matrix.buildType}}.${{matrix.architecture}}.sln /m /t:Rebuild /p:Configuration=Release,Platform=${{matrix.architecture}} | |
| - name: Prepare artifacts | |
| shell: cmd | |
| run: | | |
| del "Artifacts\bin\*.pdb" /Q 2>nul | |
| del "Artifacts\lib\*.pdb" /Q 2>nul | |
| for %%F in ("Artifacts\lib\*.lib") do ( | |
| echo %%~nxF >> "Artifacts\pre-build-libs.txt" | |
| ) | |
| powershell -Command "Compress-Archive -Path 'Artifacts\*' -DestinationPath '${{ env.ARTIFACT_NAME }}.zip'" | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }} | |
| path: ${{ env.ARTIFACT_NAME }}.zip | |
| release: | |
| name: Create release | |
| if: github.event_name == 'workflow_dispatch' | |
| runs-on: windows-2022 | |
| needs: | |
| - build-linux | |
| - build-linux-musl | |
| - build-macos | |
| - build-macos-x64 | |
| - build-wasm | |
| - build-windows | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v6 | |
| name: Download artifacts | |
| with: | |
| path: ${{ github.workspace }}/Artifacts | |
| merge-multiple: true | |
| - name: Set version | |
| shell: bash | |
| run: echo "VERSION=$(date +'%Y.%m.%d.%H%M')" >> $GITHUB_ENV | |
| - name: Create and push tag | |
| shell: bash | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag $VERSION | |
| git push origin $VERSION | |
| - name: Publish release | |
| shell: cmd | |
| env: | |
| GH_TOKEN: ${{github.token}} | |
| run: gh release create %VERSION% --title "Release %VERSION%" ${{github.workspace}}\Artifacts\*.zip |