Skip to content

update action

update action #22

Workflow file for this run

name: MSBuild
on:
push:
tags:
- '*'
env:
SOLUTION_FILE_PATH: .
BUILD_CONFIGURATION: fne_release
BUILD_PLATFORM: x86
LANG: zh_CN.UTF-8
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" -Encoding UTF8) | ForEach-Object {$_ -replace "0\.0\.0", "$env:GITHUB_REF_NAME"} | Set-Content ".\AutoLinker.h" -Encoding UTF8
shell: pwsh
- name: Set Build
run: (Get-Content ".\AutoLinker.h" -Encoding UTF8) | ForEach-Object {$_ -replace "1000000", "$env:GITHUB_RUN_NUMBER"} | Set-Content ".\AutoLinker.h" -Encoding UTF8
shell: pwsh
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
msbuild ${{env.SOLUTION_FILE_PATH}}/AutoLinker.vcxproj -t:rebuild -verbosity:normal -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 }}