Merge branch 'master' into ci-autoconfig #21
This file contains 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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: ZZZBotris.Net CI | |
on: | |
push: | |
branches: [ci-*, master] | |
tags: [ pre*, v* ] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [macos, ubuntu, windows] | |
runs-on: ${{matrix.os}}-latest | |
env: | |
OUTPUT_FOLDER: ./build | |
PROJECT_NAME: ZZZTOJ.Botris | |
TETRIS_AI_INPUT_FILENAME: ${{ fromJSON('{"macos":"libtetris_ai.dylib","ubuntu":"libtetris_ai.so","windows":"tetris_ai.dll"}')[matrix.os] }} | |
TETRIS_AI_OUTPUT_FILENAME: ${{ fromJSON('{"macos":"zzz_botris.dylib","ubuntu":"zzz_botris.so","windows":"zzz_botris.dll"}')[matrix.os] }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Project | |
uses: ./.github/actions/build_dotnet | |
with: | |
output_folder: ${{ env.OUTPUT_FOLDER }} | |
project_name: ${{ env.PROJECT_NAME }} | |
- name: Get tetris_ai_runner | |
uses: ./.github/actions/get_tetris_ai | |
with: | |
os: ${{ matrix.os }} | |
output_folder: ${{ env.OUTPUT_FOLDER }} | |
- name: Upload dotnet test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PROJECT_NAME }}_${{ matrix.os }} | |
path: ${{ env.OUTPUT_FOLDER }}/* | |
- name: Prepare for release | |
if: ${{ (startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v'))}} | |
run: | | |
7z a -tzip ${{ env.PROJECT_NAME }}_${{ matrix.os }}.zip ${{ env.OUTPUT_FOLDER }}/* | |
- name: Upload release | |
if: ${{ (startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v'))}} | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
artifacts: | | |
${{ env.PROJECT_NAME }}_${{ matrix.os }}.zip | |
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }} |