Skip to content

Commit b4b9d79

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

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

.github/workflows/release.yml

Lines changed: 19 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,19 @@ 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: dotnet publish ${{ env.PROJECT }} \
37+
-c Release \
38+
-r ${{ matrix.runtime }} \
39+
--self-contained true \
40+
/p:PublishSingleFile=true \
41+
/p:IncludeNativeLibrariesForSelfExtract=true \
42+
/p:DebugType=none \
43+
/p:DebugSymbols=false
3644

37-
# Upload the artifact
38-
- name: Upload artifact
45+
- name: Upload artifact for ${{ matrix.runtime }}
3946
uses: actions/upload-artifact@v3
4047
with:
41-
name: convertApi-cli
42-
path: ${{ env.PUBLISH_DIR }}
48+
name: convertApi-cli-${{ matrix.runtime }}
49+
path: ConvertApi.Cli/bin/Release/${{ env.FRAMEWORK }}/${{ matrix.runtime }}/publish
4350
retention-days: 1

0 commit comments

Comments
 (0)