Update cmake-multi-platform.yml

This commit is contained in:
2025-11-06 23:42:19 +00:00
committed by GitHub
parent dada2f73be
commit 853211e575

View File

@@ -6,6 +6,9 @@ on:
- "v*" - "v*"
workflow_dispatch: workflow_dispatch:
permissions:
contents: write
jobs: jobs:
build: build:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -118,25 +121,29 @@ jobs:
working-directory: ${{ steps.strings.outputs.build-output-dir }} working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }} run: ctest --build-config ${{ matrix.build_type }}
- name: Create Release ZIP - name: Create Release ZIP (Windows)
if: matrix.platform == 'Windows'
run: | run: |
cd ${{ steps.strings.outputs.build-output-dir }} cd build/${{ matrix.build_type }}
if [ "${{ matrix.platform }}" = "Web" ]; then Compress-Archive -Path *.exe -DestinationPath ../../${{ matrix.artifact_name }}.zip
shell: pwsh
- name: Create Release ZIP (Web)
if: matrix.platform == 'Web'
run: |
cd build
zip -r ../${{ matrix.artifact_name }}.zip *.html *.js *.data zip -r ../${{ matrix.artifact_name }}.zip *.html *.js *.data
elif [ "${{ matrix.platform }}" = "Windows" ]; then
cd ${{ matrix.build_type }}
zip -r ../../${{ matrix.artifact_name }}.zip *.exe
else
zip -r ../${{ matrix.artifact_name }}.zip * -x "*.cmake" "*.txt" "*.json" "*.a" "*.o" "*.d" "*.make" "*.internal" "*.marks" "Makefile" ".ninja*" "*.ninja" "CMakeFiles/*"
fi
shell: bash shell: bash
- name: Create Release - name: Create Release ZIP (Linux/macOS)
uses: softprops/action-gh-release@v1 if: matrix.platform == 'Linux' || matrix.platform == 'MacOS'
run: |
cd build
zip -r ../${{ matrix.artifact_name }}.zip * -x "*.cmake" "*.txt" "*.json" "*.a" "*.o" "*.d" "*.make" "*.internal" "*.marks" "Makefile" ".ninja*" "*.ninja" "CMakeFiles/*"
shell: bash
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with: with:
files: ${{ matrix.artifact_name }}.zip name: ${{ matrix.artifact_name }}
draft: false path: ${{ matrix.artifact_name }}.zip
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}