Skip to content

编译优化

编译优化 #17

Workflow file for this run

name: MSBuild
on:
push:
tags:
- '*'
env:
SOLUTION_FILE_PATH: .
BUILD_CONFIGURATION: fne_release
BUILD_PLATFORM: x86
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- name: Set System Locale to Chinese
run: |
Set-WinSystemLocale zh-CN
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Set Version
run: (Get-Content ".\AutoLinker.h") -replace "0\.0\.0", "$env:GITHUB_REF_NAME" | Set-Content ".\AutoLinker.h"
shell: pwsh
- name: Set Build
run: (Get-Content ".\AutoLinker.h") -replace "1000000", "$env:GITHUB_RUN_NUMBER" | Set-Content ".\AutoLinker.h"
shell: pwsh
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
msbuild ${{env.SOLUTION_FILE_PATH}}/AutoLinker.vcxproj -t:rebuild -verbosity:diag -property:Configuration=${{env.BUILD_CONFIGURATION}} -property:Platform=${{env.BUILD_PLATFORM}}
- name: Compress-Archive
run: |
powershell Compress-Archive -Path "bin/${{env.BUILD_CONFIGURATION}}/AutoLinker.fne" -DestinationPath AutoLinker-${{github.ref_name}}.zip
- name: Create a Release
uses: ncipollo/release-action@v1
with:
artifacts: "AutoLinker-${{github.ref_name}}.zip"
token: ${{ secrets.GITHUB_TOKEN }}