-
Notifications
You must be signed in to change notification settings - Fork 4
82 lines (70 loc) · 2.33 KB
/
release.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
packages: read # for package dependencies
actions: read # for checking out code
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
working-directory: ./NeatShift
run: dotnet restore NeatShift.sln
- name: Build
working-directory: ./NeatShift
run: dotnet build NeatShift.sln --configuration Release --no-restore
- name: Publish
working-directory: ./NeatShift
run: |
dotnet publish "NeatShift/NeatShift.csproj" -c Release -r win-x64 `
--self-contained true `
-p:PublishSingleFile=true `
-p:EnableCompressionInSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-p:DebugType=None `
-p:DebugSymbols=false `
-p:PublishReadyToRun=true `
-p:PublishTrimmed=false `
-p:ApplicationManifest=app.manifest `
-p:WindowsPackageType=None `
-p:IncludeAllContentForSelfExtract=true `
-o ../publish
- name: Copy exe to release
run: Copy-Item "publish/NeatShift.exe" -Destination "NeatShift.exe"
- name: Create Runtime Config
run: |
Set-Content -Path "publish/NeatShift.runtimeconfig.json" -Value '{
"runtimeOptions": {
"tfm": "net6.0-windows",
"framework": {
"name": "Microsoft.WindowsDesktop.App",
"version": "6.0.0"
},
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
}
}
}'
- name: Zip Release with Config
run: Compress-Archive -Path "publish/*" -DestinationPath "NeatShift-Release.zip"
- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
NeatShift.exe
NeatShift-Release.zip
draft: false
prerelease: false
generate_release_notes: true
tag_name: ${{ github.ref_type == 'tag' && github.ref_name || 'v1.0.0' }}