forked from MtnDewIt/TagTool-NET-Test
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (52 loc) · 1.94 KB
/
Copy pathbuild.yml
File metadata and controls
67 lines (52 loc) · 1.94 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
name: TagTool Build
on:
push:
branches: [ "dev" ]
jobs:
build-win:
env:
TARGET_FRAMEWORK: net8.0-windows
PLATFORM: x64
strategy:
matrix:
BUILD_CONFIGURATION: [ Debug, Release ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Initialize Submodules
uses: snickerbockers/submodules-init@v4
- name: Determine Version
id: determine_version
run: |
$version = (git rev-parse --short=7 HEAD).Trim()
Write-Output "Version determined: $version"
Write-Host "::set-output name=version::$version"
- name: Install 7Zip
run: |
Invoke-WebRequest -Uri "https://www.7-zip.org/a/7z1900-x64.msi" -OutFile "$env:TEMP\7z.msi"
Start-Process -Wait -FilePath msiexec -ArgumentList "/i", "$env:TEMP\7z.msi", "/quiet"
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.5
- name: Restore Packages
run: nuget restore TagTool.sln
- name: Build solution
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: msbuild TagTool.sln /t:rebuild /p:Platform=${{ env.PLATFORM }} /p:Configuration=${{ matrix.BUILD_CONFIGURATION }} /p:TargetFramework=${{ env.TARGET_FRAMEWORK }}
- name: Zip Release
run: |
& "C:\Program Files\7-Zip\7z.exe" a ${{ matrix.BUILD_CONFIGURATION }}_${{ env.PLATFORM }}.7z ./TagTool/bin/${{ env.PLATFORM }}/${{ matrix.BUILD_CONFIGURATION }}/${{ env.TARGET_FRAMEWORK }}*
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.BUILD_CONFIGURATION }}_${{ env.PLATFORM }}.7z
tag_name: ${{ steps.determine_version.outputs.version }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}