Skip to content

Commit

Permalink
Update build-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ax-6 authored Sep 30, 2024
1 parent 7c6fbf6 commit 59122a5
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Release

on:
release:
types: [created, published, edited, deleted, prereleased, unpublished]
types: [created, published, edited, prereleased]

jobs:
build:
Expand All @@ -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

0 comments on commit 59122a5

Please sign in to comment.