@@ -28,10 +28,12 @@ jobs:
2828 - name : Checkout repository
2929 uses : actions/checkout@v4
3030
31- - name : Setup .NET 8 SDK
31+ - name : Setup .NET 8 & 9
3232 uses : actions/setup-dotnet@v4
3333 with :
34- dotnet-version : ' 8.0.x'
34+ dotnet-version : |
35+ 8.0.x
36+ 9.0.x
3537
3638 - name : Cache NuGet packages
3739 uses : actions/cache@v4
@@ -80,104 +82,15 @@ jobs:
8082 - name : Checkout repository
8183 uses : actions/checkout@v4
8284
83- - name : Setup .NET 8 SDK
85+ - name : Setup .NET 8 & 9
8486 uses : actions/setup-dotnet@v4
8587 with :
86- dotnet-version : ' 8.0.x'
88+ dotnet-version : |
89+ 8.0.x
90+ 9.0.x
8791
8892 - name : Restore dependencies
8993 run : dotnet restore
9094
9195 - name : Check for vulnerable packages
92- run : dotnet list package --vulnerable --include-transitive
93-
94- - name : Check for deprecated packages
95- run : dotnet list package --deprecated
96-
97- publish :
98- runs-on : ubuntu-latest
99- needs : [test, security]
100- if : success()
101- strategy :
102- fail-fast : false
103- matrix :
104- runtime :
105- - win-x64
106- - linux-x64
107- - osx-x64
108-
109- steps :
110- - name : Checkout repository
111- uses : actions/checkout@v4
112-
113- - name : Setup .NET 8 SDK
114- uses : actions/setup-dotnet@v4
115- with :
116- dotnet-version : ' 8.0.x'
117-
118- - name : Cache NuGet packages
119- uses : actions/cache@v4
120- with :
121- path : ~/.nuget/packages
122- key : ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
123- restore-keys : ${{ runner.os }}-nuget-
124-
125- - name : Restore dependencies
126- run : dotnet restore "${{ env.PROJECT_PATH }}"
127-
128- - name : Publish single-file executable (${{ matrix.runtime }})
129- run : |
130- dotnet publish "${{ env.PROJECT_PATH }}" \
131- -c ${{ env.CONFIGURATION }} \
132- -r ${{ matrix.runtime }} \
133- --self-contained true \
134- /p:PublishSingleFile=true \
135- /p:PublishTrimmed=true \
136- /p:TrimMode=Link \
137- /p:EnableCompressionInSingleFile=true
138-
139- - name : Test published executable (${{ matrix.runtime }})
140- run : |
141- PUBLISH_DIR="src/PrintZPL.Host/bin/${{ env.CONFIGURATION }}/${{ env.FRAMEWORK }}/${{ matrix.runtime }}/publish"
142- if [[ "${{ matrix.runtime }}" == "win-x64" ]]; then
143- echo "Skipping Windows executable test on Linux runner"
144- else
145- chmod +x "$PUBLISH_DIR/PrintZPL.Host"
146- timeout 10s "$PUBLISH_DIR/PrintZPL.Host" --console || true
147- fi
148-
149- - name : Zip published output (${{ matrix.runtime }})
150- run : |
151- PUBLISH_DIR="src/PrintZPL.Host/bin/${{ env.CONFIGURATION }}/${{ env.FRAMEWORK }}/${{ matrix.runtime }}/publish"
152- ZIP_NAME="PrintZPL-${{ matrix.runtime }}.zip"
153- cd "$PUBLISH_DIR"
154- zip -r "${{ github.workspace }}/$ZIP_NAME" .
155-
156- - name : Upload artifact for ${{ matrix.runtime }}
157- uses : actions/upload-artifact@v4
158- with :
159- name : PrintZPL-${{ matrix.runtime }}
160- path : PrintZPL-${{ matrix.runtime }}.zip
161-
162- release :
163- runs-on : ubuntu-latest
164- needs : publish
165- if : startsWith(github.ref, 'refs/tags/v')
166-
167- steps :
168- - name : Download all artifacts
169- uses : actions/download-artifact@v4
170- with :
171- pattern : PrintZPL-*
172- merge-multiple : true
173-
174- - name : Create GitHub Release
175- uses : softprops/action-gh-release@v1
176- with :
177- files : |
178- PrintZPL-*.zip
179- generate_release_notes : true
180- draft : false
181- prerelease : false
182- env :
183- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
96+ run : dotnet list package --vulner
0 commit comments