Skip to content

Commit

Permalink
- Add macOS to workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
ParticleG committed Aug 9, 2024
1 parent b711836 commit 955473b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,47 @@ jobs:
${{ env.RELEASE_FOLDER }}/*
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}

build-macos:
runs-on: macos-latest
needs: get-info
env:
OUTPUT_FOLDER: ./build
PROJECT_NAME: tetris_ai
RELEASE_FOLDER: ./release
strategy:
matrix:
config: [ Debug, Release ]
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup CMake
uses: lukka/get-cmake@latest
- name: CMake Configure and Build
run: |
cmake -S "${{ github.workspace }}" -B "${{ github.workspace }}/${{ env.OUTPUT_FOLDER }}" -DCMAKE_BUILD_TYPE=${{ matrix.config }}
cmake --build "${{ github.workspace }}/${{ env.OUTPUT_FOLDER }}" --target ${{ env.PROJECT_NAME }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}_${{ needs.get-info.outputs.branchName }}_${{ needs.get-info.outputs.commitHash }}_${{ GITHUB.RUN_NUMBER }}_macOS_${{ matrix.config }}
path: "${{ env.OUTPUT_FOLDER }}/*.dylib"
- name: Prepare for release
if: ${{ (startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v')) && matrix.config == 'Release'}}
shell: bash
run: |
mkdir -p ${{ env.RELEASE_FOLDER }}
cp ${{ env.OUTPUT_FOLDER }}/*.dylib ${{ env.RELEASE_FOLDER }}
- name: Upload release
if: ${{ (startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v')) && matrix.config == 'Release'}}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: |
${{ env.RELEASE_FOLDER }}/*
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}


build-windows:
runs-on: windows-latest
needs: get-info
Expand Down

0 comments on commit 955473b

Please sign in to comment.