Skip to content

Commit 0e87941

Browse files
authored
Update build.yml
1 parent b29c641 commit 0e87941

File tree

1 file changed

+34
-35
lines changed

1 file changed

+34
-35
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -25,44 +25,43 @@ jobs:
2525
- osx-x64
2626

2727
steps:
28-
- name: Checkout repo
29-
uses: actions/checkout@v3
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
3030

31-
- name: Setup .NET SDK
32-
uses: actions/setup-dotnet@v3
33-
with:
34-
dotnet-version: '6.0.x'
31+
- name: Setup .NET 6 SDK
32+
uses: actions/setup-dotnet@v3
33+
with:
34+
dotnet-version: '6.0.x'
3535

36-
- name: Cache NuGet packages
37-
uses: actions/cache@v3
38-
with:
39-
path: ~/.nuget/packages
40-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
41-
restore-keys: |
42-
${{ runner.os }}-nuget-
36+
- name: Cache NuGet packages
37+
uses: actions/cache@v3
38+
with:
39+
path: ~/.nuget/packages
40+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
41+
restore-keys: ${{ runner.os }}-nuget-
4342

44-
- name: Restore dependencies
45-
run: dotnet restore ${{ env.PROJECT_PATH }}
43+
- name: Restore dependencies
44+
run: dotnet restore "${{ env.PROJECT_PATH }}"
4645

47-
- name: Publish single-file executable (${{ matrix.runtime }})
48-
run: |
49-
dotnet publish ${{ env.PROJECT_PATH }} \
50-
-c ${{ env.CONFIGURATION }} \
51-
-r ${{ matrix.runtime }} \
52-
--self-contained true \
53-
/p:PublishSingleFile=true \
54-
/p:PublishTrimmed=true \
55-
/p:TrimMode=Link
46+
- name: Publish single-file executable (${{ matrix.runtime }})
47+
run: |
48+
dotnet publish "${{ env.PROJECT_PATH }}" \
49+
-c ${{ env.CONFIGURATION }} \
50+
-r ${{ matrix.runtime }} \
51+
--self-contained true \
52+
/p:PublishSingleFile=true \
53+
/p:PublishTrimmed=true \
54+
/p:TrimMode=Link
5655
57-
- name: Zip published output (${{ matrix.runtime }})
58-
run: |
59-
RUNTIME_DIR=src/PrintZPL.Host/bin/${{ env.CONFIGURATION }}/${{ env.FRAMEWORK }}/${{ matrix.runtime }}/publish
60-
ZIP_NAME=PrintZPL-${{ matrix.runtime }}.zip
61-
cd $RUNTIME_DIR
62-
zip -r ${{ github.workspace }}/$ZIP_NAME .
56+
- name: Zip published output (${{ matrix.runtime }})
57+
run: |
58+
PUBLISH_DIR="src/PrintZPL.Host/bin/${{ env.CONFIGURATION }}/${{ env.FRAMEWORK }}/${{ matrix.runtime }}/publish"
59+
ZIP_NAME="PrintZPL-${{ matrix.runtime }}.zip"
60+
cd "$PUBLISH_DIR"
61+
zip -r "${{ github.workspace }}/$ZIP_NAME" .
6362
64-
- name: Upload artifact for ${{ matrix.runtime }}
65-
uses: actions/upload-artifact@v2
66-
with:
67-
name: PrintZPL-${{ matrix.runtime }}
68-
path: PrintZPL-${{ matrix.runtime }}.zip
63+
- name: Upload artifact for ${{ matrix.runtime }}
64+
uses: actions/upload-artifact@v3.1.2
65+
with:
66+
name: PrintZPL-${{ matrix.runtime }}
67+
path: PrintZPL-${{ matrix.runtime }}.zip

0 commit comments

Comments
 (0)