@@ -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- 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- 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
0 commit comments