Skip to content

Commit

Permalink
ci: Publishing application as self-contained executable (#101)
Browse files Browse the repository at this point in the history
* trim trailing whitespace

* update workflow file
  • Loading branch information
startgenshin authored Dec 17, 2023
1 parent 6437866 commit 6182d15
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 30 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ jobs:

steps:
- uses: actions/[email protected]

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 8.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build

- name: Publish
run: dotnet publish -c Release
working-directory: ./SubRenamer

- name: Upload Build Artifact
uses: actions/[email protected]
with:
Expand Down
46 changes: 21 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,47 @@ on:
push:
tags:
- "v*.*.*"

jobs:
build:
runs-on: windows-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"

steps:
- uses: actions/[email protected]

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 8.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build

- name: Publish
run: dotnet publish -r win-x64 -p:PublishSingleFile=true -c Release --self-contained false
working-directory: ./SubRenamer


- name: Publish
run: dotnet publish -r win-arm64 -p:PublishSingleFile=true -c Release --self-contained false
run: |
dotnet publish -c Release -r win-x64 -p:PublishSingleFile=true -p:PublishDir=.\artifacts\win-x64-with-runtime --self-contained true
dotnet publish -c Release -r win-arm64 -p:PublishSingleFile=true -p:PublishDir=.\artifacts\win-arm64-with-runtime --self-contained true
dotnet publish -c Release -r win-x64 -p:PublishSingleFile=true -p:PublishDir=.\artifacts\win-x64 --self-contained false
dotnet publish -c Release -r win-arm64 -p:PublishSingleFile=true -p:PublishDir=.\artifacts\win-arm64 --self-contained false
working-directory: ./SubRenamer

- name: Zip Build Artifact
uses: vimtor/action-zip@v1
with:
files: ./SubRenamer/bin/Release/net8.0-windows/win-x64/publish
dest: SubRenamer-win-x64.zip

- name: Zip Build Artifact
uses: vimtor/action-zip@v1
with:
files: ./SubRenamer/bin/Release/net8.0-windows/win-arm64/publish
dest: SubRenamer-win-arm64.zip


- name: Compress Build Artifact
run: |
Compress-Archive -Path .\SubRenamer\artifacts\win-x64-with-runtime\* -DestinationPath .\SubRenamer-with-runtime-win-x64.zip
Compress-Archive -Path .\SubRenamer\artifacts\win-arm64-with-runtime\* -DestinationPath .\SubRenamer-with-runtime-win-arm64.zip
Compress-Archive -Path .\SubRenamer\artifacts\win-x64\* -DestinationPath .\SubRenamer-win-x64.zip
Compress-Archive -Path .\SubRenamer\artifacts\win-arm64\* -DestinationPath .\SubRenamer-win-arm64.zip
Get-FileHash -Path .\SubRenamer*.zip | Format-List > sha256sum.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
SubRenamer-win-x64.zip
SubRenamer-win-arm64.zip
SubRenamer*.zip
sha256sum.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6182d15

Please sign in to comment.