This repository was archived by the owner on Jun 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (61 loc) · 2.2 KB
/
Copy pathmsbuild.yml
File metadata and controls
70 lines (61 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: MSBuild
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version_name:
description: 'The special version name'
required: false
default: '0.0.0'
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
jobs:
build:
runs-on: windows-2019
strategy:
matrix:
configuration: [ 'Release' ]
platform: [ 'x64' ]
steps:
- uses: actions/checkout@v2
- name: Check Out Tag-Name
id: checkout-tagname
shell: "python3 {0}"
run: |
import os
import re
sp_ver = '${{ github.event.inputs.version_name }}'
ref = os.getenv('GITHUB_REF', '')
run_id = os.getenv('GITHUB_RUN_ID', '')
match = re.search(r'refs\/tags\/(.*)', ref)
tag_name = match[1] if match is not None else (sp_ver if sp_ver != '' else run_id)
print('::set-output name=tag_name::'+tag_name)
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Build
env:
tag_name: ${{ steps.checkout-tagname.outputs.tag_name }}
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: |
python3 .github\write_file.py LittleWrapper\resources\app_version.txt ${{ env.tag_name }}
msbuild /m /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} ${{env.SOLUTION_FILE_PATH}}
dir
dir Dest
cd Dest
ren lw.exe lw-${{ env.tag_name }}-${{ matrix.configuration }}-${{ matrix.platform }}.exe
ren lw.pdb lw-${{ env.tag_name }}-${{ matrix.configuration }}-${{ matrix.platform }}.pdb
- name: Publish Release
uses: xresloader/upload-to-github-release@v1.3.0
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
tag_name: ${{ steps.checkout-tagname.outputs.tag_name }}
with:
file: Dest/lw-${{ env.tag_name }}-${{ matrix.configuration }}-${{ matrix.platform }}.*
draft: false
tags: false
tag_name: ${{ env.tag_name }}