Use a wildcard for the files to upload instead. #32
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 | |
| paths: | |
| - .github/workflows/release.yml | |
| - .github/workflows/clone-dependencies.sh | |
| name: Create release | |
| jobs: | |
| build_windows: | |
| name: Build 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: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Clone dependencies | |
| shell: cmd | |
| run: clone-dependencies.cmd | |
| - name: Download Configure | |
| shell: cmd | |
| run: download-configure.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' || ''}} | |
| - name: Build dependencies | |
| 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@v4 | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }} | |
| path: ${{ env.ARTIFACT_NAME }}.zip | |
| release: | |
| name: Create release | |
| runs-on: windows-2022 | |
| needs: build_windows | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| name: Download executables | |
| with: | |
| path: ${{ github.workspace }}/Artifacts | |
| merge-multiple: true | |
| - name: Set release number | |
| shell: bash | |
| run: echo "release=$(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 $release | |
| git push origin $release | |
| - name: Publish release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ env.release }} | |
| tag_name: ${{ env.release }} | |
| files: | | |
| ${{ github.workspace }}/Artifacts/*.zip |