Skip to content

Commit

Permalink
Build on target platform
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoboss committed Aug 31, 2024
1 parent acb1d9d commit 4da54a5
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,22 @@ jobs:
if: github.ref == 'refs/heads/main'
needs: test

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
os: ['win', 'linux', 'osx']
arch: ['x64', 'arm64']
rid: ['win-x64', 'linux-x64', 'osx-x64']
os: ['windows-latest', 'ubuntu-latest', 'macos-latest']
include:
- rid: 'win-x64'
os: 'windows-latest'
- rid: 'linux-x64'
os: 'ubuntu-latest'
- rid: 'osx-x64'
os: 'macos-latest'

runs-on: ${{ matrix.os }}

name: Publish for ${{ matrix.os }} ${{ matrix.arch }}
name: Publish for ${{ matrix.rid }}

steps:
- uses: actions/checkout@v4
Expand All @@ -49,13 +56,13 @@ jobs:
with:
global-json-file: global.json
- name: Restore dependencies
run: dotnet restore -r ${{ matrix.os }}-${{ matrix.arch }}
run: dotnet restore -r ${{ matrix.rid }}
- name: Build
run: dotnet build --no-restore -c Release -r ${{ matrix.os }}-${{ matrix.arch }} D3pth.CLI/D3pth.CLI.csproj
run: dotnet build --no-restore -c Release -r ${{ matrix.rid }} D3pth.CLI/D3pth.CLI.csproj
- name: Publish
run: dotnet publish --no-build -c Release -r ${{ matrix.os }}-${{ matrix.arch }} -o publish D3pth.CLI/D3pth.CLI.csproj
run: dotnet publish --no-build -c Release -r ${{ matrix.rid }} -o publish D3pth.CLI/D3pth.CLI.csproj
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: publish-${{ matrix.os }}-${{ matrix.arch }}
name: publish-${{ matrix.rid }}
path: publish/*

0 comments on commit 4da54a5

Please sign in to comment.