Skip to content

Commit 37ea2c0

Browse files
authored
Merge pull request #17 from wheeheee/dotnet8-migration
Migration to .NET 8
2 parents 85b291b + 1a47c35 commit 37ea2c0

File tree

13 files changed

+316
-358
lines changed

13 files changed

+316
-358
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
1-
name: MSBuild
2-
on: [push]
1+
name: Build
2+
on: [push, pull_request, workflow_dispatch]
33

44
jobs:
55
build:
66

77
runs-on: windows-latest
88

99
steps:
10-
- uses: actions/checkout@master
11-
12-
- name: Add msbuild to PATH
13-
uses: microsoft/[email protected]
14-
15-
- name: Setup NuGet
16-
uses: NuGet/[email protected]
10+
- uses: actions/checkout@v4
1711

18-
- name: Restore NuGet packages
19-
run: nuget restore
20-
21-
- name: Build app for release
22-
run: msbuild WinToLinux.sln -p:Configuration=Release
12+
- uses: actions/setup-dotnet@v4
13+
with:
14+
dotnet-version: '8.0.x'
15+
- run: dotnet build

.github/workflows/release.yml

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,46 @@ jobs:
1111
name: Upload Release Asset
1212
runs-on: windows-latest
1313
steps:
14-
- uses: actions/checkout@master
14+
- uses: actions/checkout@v4
1515

16-
- name: Setup MSBuild.exe
17-
uses: warrenbuckley/Setup-MSBuild@v1
16+
- name: Setup .NET SDK
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: '8.x'
1820

19-
- name: MSBuild
20-
run: msbuild WinToLinux.sln /property:Configuration=Release
21+
- name: Build solution
22+
run: dotnet build
23+
24+
- name: Publish app
25+
run: |
26+
dotnet publish WinToLinux.slnx -p:PublishSingleFile=true -c Release --sc false --arch x64
27+
dotnet publish WinToLinux.slnx -p:PublishSingleFile=true -c Release --sc false --arch x86
28+
dotnet publish WinToLinux.slnx -p:PublishSingleFile=true -c Release --sc false --arch arm64
29+
30+
- name: Zip published output
31+
run: |
32+
Compress-Archive -Path ./bin/Release/*/win-x64/publish -DestinationPath WinToLinux_x64.zip
33+
Compress-Archive -Path ./bin/Release/*/win-x86/publish -DestinationPath WinToLinux_x86.zip
34+
Compress-Archive -Path ./bin/Release/*/win-arm64/publish -DestinationPath WinToLinux_arm64.zip
35+
36+
- name: Rename .exe output
37+
run: |
38+
New-Item -ItemType Directory -Force -Path artifacts
39+
Move-Item -Path ./bin/Release/*/win-x64/publish/WinToLinux.exe -Destination ./artifacts/WinToLinux-x64.exe
40+
Move-Item -Path ./bin/Release/*/win-x86/publish/WinToLinux.exe -Destination ./artifacts/WinToLinux-x86.exe
41+
Move-Item -Path ./bin/Release/*/win-arm64/publish/WinToLinux.exe -Destination ./artifacts/WinToLinux-arm64.exe
42+
shell: pwsh
2143

22-
- name: Create Release
23-
id: create_release
24-
uses: actions/[email protected]
25-
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
with:
28-
tag_name: ${{ github.ref }}
29-
release_name: Release ${{ github.ref }}
30-
draft: false
31-
prerelease: false
3244
- name: Upload Release Asset
33-
id: upload-release-asset
34-
uses: actions/[email protected]
45+
uses: softprops/action-gh-release@v2
46+
with:
47+
files: |
48+
./artifacts/WinToLinux-x64.exe
49+
./artifacts/WinToLinux-x86.exe
50+
./artifacts/WinToLinux-arm64.exe
51+
WinToLinux_x64.zip
52+
WinToLinux_x86.zip
53+
WinToLinux_arm64.zip
54+
generate_release_notes: true
3555
env:
3656
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
with:
38-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
39-
asset_path: ./bin/Release/WinToLinux.exe
40-
asset_name: WinToLinux.exe
41-
asset_content_type: application/octet-stream

App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
</configuration>

0 commit comments

Comments
 (0)