Separate PlayerShip from Player #23
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
name: Windows | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'src/**' | |
- '.github/workflows/windows.yml' | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: windows-2022 | |
env: | |
PROJECT_NAME: ${{ github.event.repository.name }} | |
PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_dev_windows_x64 | |
PROJECT_CUSTOM_FLAGS: "" | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v2 | |
with: | |
path: ${{ env.PROJECT_NAME }} | |
- name: Setup Release Paths | |
run: | | |
echo "PROJECT_RELEASE_PATH=${{ env.PROJECT_NAME }}_v${{ github.event.release.tag_name }}_windows_x64" >> $GITHUB_ENV | |
shell: pwsh | |
if: github.event_name == 'release' && github.event.action == 'published' | |
- name: Setup MSBuild path | |
uses: microsoft/setup-msbuild@v1.1 | |
- name: Setup Environment | |
run: | | |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y | |
mkdir ${{ env.PROJECT_RELEASE_PATH }} | |
ls | |
shell: pwsh | |
- name: Build Product | |
run: | | |
cd ${{ env.PROJECT_NAME }} | |
cmake -B build -G "Visual Studio 17 2022" -A x64 | |
cmake --build build --config Release | |
shell: pwsh | |
- name: Generate Artifacts | |
run: | | |
Copy-Item ${{ env.PROJECT_NAME }}/build/src/Release/game.exe ${{ env.PROJECT_RELEASE_PATH }} | |
Copy-Item ${{ env.PROJECT_NAME }}/README.md ${{ env.PROJECT_RELEASE_PATH }} | |
Copy-Item ${{ env.PROJECT_NAME }}/LICENSE ${{ env.PROJECT_RELEASE_PATH }} | |
Copy-Item ${{ env.PROJECT_NAME }}/resources ${{ env.PROJECT_RELEASE_PATH }} -Recurse | |
Compress-Archive -Path ./${{ env.PROJECT_RELEASE_PATH }}/* -DestinationPath ./${{ env.PROJECT_RELEASE_PATH }}.zip | |
shell: pwsh | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.PROJECT_RELEASE_PATH }}.zip | |
path: ./${{ env.PROJECT_RELEASE_PATH }}.zip | |
- name: Upload Artifact to Release | |
uses: actions/upload-release-asset@v1.0.1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_name: ${{ env.PROJECT_RELEASE_PATH }}.zip | |
asset_path: ./${{ env.PROJECT_RELEASE_PATH }}.zip | |
asset_content_type: application/zip | |
if: github.event_name == 'release' && github.event.action == 'published' |