Skip to content

Commit f175a5f

Browse files
Creating builds for other platforms
1 parent c0620c7 commit f175a5f

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Package
1+
name: Build and Package All Runtimes
22

33
on:
44
workflow_dispatch:
@@ -12,15 +12,17 @@ jobs:
1212
timeout-minutes: 30
1313
env:
1414
GITHUB_ACTIONS: true
15-
PUBLISH_DIR: ConvertApi.Cli/bin/Release/net8.0/win-x64/publish
16-
OUTPUT_DIR: output
15+
FRAMEWORK: net8.0
16+
PROJECT: ConvertApi.Cli/ConvertApi.Cli.csproj
17+
18+
strategy:
19+
matrix:
20+
runtime: [ "win-x64", "linux-x64", "linux-arm64", "osx-x64", "osx-arm64" ]
1721

1822
steps:
19-
# Checkout the code
2023
- name: Checkout
2124
uses: actions/checkout@v4
2225

23-
# Setup .NET SDK
2426
- name: Setup .NET SDK
2527
uses: actions/setup-dotnet@v4
2628
with:
@@ -30,14 +32,20 @@ jobs:
3032
# - name: Test
3133
# run: dotnet test ConvertApi.Cli.Tests
3234

33-
# Build the project
34-
- name: Build
35-
run: dotnet publish ConvertApi.Cli/ConvertApi.Cli.csproj -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:DebugType=none /p:DebugSymbols=false
35+
- name: Publish for ${{ matrix.runtime }}
36+
run: |
37+
dotnet publish ${{ env.PROJECT }} \
38+
-c Release \
39+
-r ${{ matrix.runtime }} \
40+
--self-contained true \
41+
/p:PublishSingleFile=true \
42+
/p:IncludeNativeLibrariesForSelfExtract=true \
43+
/p:DebugType=none \
44+
/p:DebugSymbols=false
3645
37-
# Upload the artifact
38-
- name: Upload artifact
46+
- name: Upload artifact for ${{ matrix.runtime }}
3947
uses: actions/upload-artifact@v3
4048
with:
41-
name: convertApi-cli
42-
path: ${{ env.PUBLISH_DIR }}
49+
name: convertApi-cli-${{ matrix.runtime }}
50+
path: ConvertApi.Cli/bin/Release/${{ env.FRAMEWORK }}/${{ matrix.runtime }}/publish
4351
retention-days: 1

0 commit comments

Comments
 (0)