From 59122a5166d07a33fd18e2983e035522c4c5bf1b Mon Sep 17 00:00:00 2001 From: Xie Zicong Date: Mon, 30 Sep 2024 18:25:56 +0800 Subject: [PATCH] Update build-release.yml --- .github/workflows/build-release.yml | 49 ++++++++++++++++++----------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 617ec11..ebf5ab6 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -2,7 +2,7 @@ name: Build and Release on: release: - types: [created, published, edited, deleted, prereleased, unpublished] + types: [created, published, edited, prereleased] jobs: build: @@ -12,44 +12,55 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - build_type: [Release] - c_compiler: [gcc, clang, cl] + arch: [x86, x64] include: - os: ubuntu-latest + arch: x86 c_compiler: gcc cpp_compiler: g++ + - os: ubuntu-latest + arch: x64 + c_compiler: gcc + cpp_compiler: g++ + - os: windows-latest + arch: x86 + c_compiler: cl + cpp_compiler: cl - os: windows-latest + arch: x64 c_compiler: cl cpp_compiler: cl - os: macos-latest + arch: x86 + c_compiler: clang + cpp_compiler: clang++ + - os: macos-latest + arch: x64 c_compiler: clang cpp_compiler: clang++ - exclude: - - os: ubuntu-latest - c_compiler: clang - - os: ubuntu-latest - c_compiler: cl - - os: windows-latest - c_compiler: gcc - - os: windows-latest - c_compiler: clang - - os: macos-latest - c_compiler: gcc - - os: macos-latest - c_compiler: cl steps: - uses: actions/checkout@v3 - name: Configure CMake run: | - cmake -B build -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} -DCMAKE_CXX_FLAGS_RELEASE="-O3" + cmake -B build -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=Release -S ${{ github.workspace }} -DCMAKE_CXX_FLAGS_RELEASE="-O3" - name: Build - run: cmake --build build --config ${{ matrix.build_type }} + run: cmake --build build --config Release - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: aq-${{ github.event.release.tag_name }}-${{ matrix.os }}.zip + name: aq-${{ github.event.release.tag_name }}-${{ matrix.os }}-${{ matrix.arch }} path: build/* + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: build/* + asset_name: aq-${{ github.event.release.tag_name }}-${{ matrix.os }}-${{ matrix.arch }} + asset_content_type: application/zip