Skip to content

Commit

Permalink
Update msbuild.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
chadlrnsn committed Oct 21, 2024
1 parent ee09d6b commit 6a410c4
Showing 1 changed file with 13 additions and 48 deletions.
61 changes: 13 additions & 48 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,30 @@
name: MSBuild
name: C++ CI

on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]

env:
SOLUTION_FILE_PATH: ./wuwa-moonlight.sln
tag1: V${{ github.run_number }}
BUILD_ID: ${{ github.run_id }} # Уникальный идентификатор для сборки

permissions:
contents: read

jobs:
build:
runs-on: windows-latest

strategy:
matrix:
configuration: [Release, Debug]
platform: [x64]

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/checkout@v2

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Build
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
msbuild /m /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} ${{env.SOLUTION_FILE_PATH}}
uses: microsoft/[email protected]

- name: Zip build artifacts
run: |
7z a bin-${{ matrix.configuration }}-${{ matrix.platform }}.zip ${{ github.workspace }}\bin\${{ matrix.configuration }}-${{ matrix.platform }}\*
- name: Build solution
run: msbuild /m /p:Platform=x64 YourSolution.sln

- name: Upload build artifacts
uses: actions/upload-artifact@v4
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Artifact-${{ matrix.configuration }}-${{ matrix.platform }}
path: bin-${{ matrix.configuration }}-${{ matrix.platform }}.zip

# Опционально: публикация релиза
# release:
# needs: build
# runs-on: ubuntu-latest
# permissions:
# contents: write
# steps:
# - name: Download a Build Artifact
# uses: actions/[email protected]
# with:
# name: my-artifact
# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# tag_name: ${{ env.tag1 }}
# files: bin-${{ matrix.configuration }}-${{ env.BUILD_ID }}.zip
name: x64-artifacts
path: |
${{github.workspace}}\bin\*-x64\**\*.dll
${{github.workspace}}\bin\*-x64\**\*.exe
${{github.workspace}}\bin\*-x64\**\*.lib
${{github.workspace}}\bin\*-x64\obj\**\*

0 comments on commit 6a410c4

Please sign in to comment.