Skip to content

Build and Release

Build and Release #13

Workflow file for this run

name: Build and Package All Runtimes
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GITHUB_ACTIONS: true
FRAMEWORK: net8.0
PROJECT: ConvertApi.Cli/ConvertApi.Cli.csproj
strategy:
matrix:
runtime: [ "win-x64", "linux-x64", "linux-arm64", "osx-x64", "osx-arm64" ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
# Run tests
# - name: Test
# run: dotnet test ConvertApi.Cli.Tests
- name: Publish for ${{ matrix.runtime }}
run: |
dotnet publish ${{ env.PROJECT }} \
-c Release \
-r ${{ matrix.runtime }} \
--self-contained true \
/p:PublishSingleFile=true \
/p:IncludeNativeLibrariesForSelfExtract=true \
/p:DebugType=none \
/p:DebugSymbols=false
- name: Upload artifact for ${{ matrix.runtime }}
uses: actions/upload-artifact@v3
with:
name: convertApi-cli-${{ matrix.runtime }}
path: ConvertApi.Cli/bin/Release/${{ env.FRAMEWORK }}/${{ matrix.runtime }}/publish
retention-days: 1