Skip to content

Commit

Permalink
Fix publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Laeng committed May 19, 2024
1 parent 1bb7400 commit 80e6c0a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ jobs:

- name: Setup nuget
uses: nuget/setup-nuget@v1



- name: Build app
run: msbuild SCTools\SCTools.sln /t:restore /t:SCTool_Redesigned:Rebuild /p:Configuration=Release /p:Platform="x64" /p:RestorePackagesConfig=true /p:RuntimeIdentifier=win-x64 /p:SelfContained=true /p:PublishSingleFile=true -m
run: msbuild SCTools\SCTools.sln /t:restore /t:SCTool_Redesigned:Rebuild /p:Configuration=Release /p:Platform="x64" -m
run: msbuild SCTools\SCTool_Redesigned\SCTool_Redesigned.csproj /t:Publish /p:Configuration=Release /p:Platform="x64" /p:RuntimeIdentifier=win-x64 /p:SelfContained=true /p:PublishSingleFile=true /p:EnableCompressionInSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -m

- name: Compress component
uses: papeloto/action-zip@v1
with:
files: SCTools\SCTool_Redesigned\bin\x64\Release
dest: Release.zip
# - name: Compress component
# uses: papeloto/action-zip@v1
# with:
# files: SCTools\SCTool_Redesigned\bin\x64\Release
# dest: Release.zip

- name: Delete tag and release
uses: dev-drprasad/[email protected]
Expand All @@ -44,8 +43,10 @@ jobs:
with:
release_name: "dev"
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: Release.zip
asset_name: Release.zip
# file: Release.zip
# asset_name: Release.zip
file: SCTools\SCTool_Redesigned\bin\x64\Release\net8.0-windows\win-x64\publish\Shatagon.exe
asset_name: Shatagon.exe
tag: dev
promote: true
prerelease: true
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ jobs:
# run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config

- name: Build app
run: msbuild SCTools\SCTools.sln /t:restore /t:SCTool_Redesigned:Rebuild /p:Configuration=Release /p:Platform="x64" /p:RestorePackagesConfig=true /p:RuntimeIdentifier=win-x64 /p:SelfContained=true /p:PublishSingleFile=true -m
run: msbuild SCTools\SCTools.sln /t:restore /t:SCTool_Redesigned:Rebuild /p:Configuration=Release /p:Platform="x64" -m
run: msbuild SCTools\SCTool_Redesigned\SCTool_Redesigned.csproj /t:Publish /p:Configuration=Release /p:Platform="x64" /p:RuntimeIdentifier=win-x64 /p:SelfContained=true /p:PublishSingleFile=true /p:EnableCompressionInSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -m

- name: Compress component
uses: papeloto/action-zip@v1
with:
files: SCTools\SCTool_Redesigned\bin\x64\Release
dest: Release.zip
# - name: Compress component
# uses: papeloto/action-zip@v1
# with:
# files: SCTools\SCTool_Redesigned\bin\x64\Release
# dest: Release.zip

- name: Get release
id: get_release
Expand All @@ -54,6 +55,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./Release.zip
asset_name: Release.zip
asset_path: ./SCTools\SCTool_Redesigned\bin\x64\Release\net8.0-windows\win-x64\publish\Shatagon.exe
asset_name: Shatagon.exe
# asset_path: ./Release.zip
# asset_name: Release.zip
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion SCTools/SCTool_Redesigned/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public static void Close()

private static string GetExecutableDir()
{
var location = new Uri(Assembly.GetExecutingAssembly().Location);
var location = new Uri(AppContext.BaseDirectory);
var dirInfo = new FileInfo(location.LocalPath).Directory;

if (dirInfo == null)
Expand Down
2 changes: 2 additions & 0 deletions SCTools/SCTool_Redesigned/SCTool_Redesigned.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<ApplicationIcon>Resources\shatagon.ico</ApplicationIcon>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<SelfContained>true</SelfContained>
</PropertyGroup>

Expand Down

0 comments on commit 80e6c0a

Please sign in to comment.