Skip to content

v2024-03-23-v3

v2024-03-23-v3 #44

name: Publish to Release
on:
workflow_dispatch:
release:
types: [published, unpublished]
jobs:
build:
strategy:
fail-fast: false
matrix:
environment: [ubuntu-22.04, windows-2022, macos-12]
include:
- environment: ubuntu-22.04
publish-runtime-id: linux-x64
- environment: windows-2022
publish-runtime-id: win-x64
- environment: macos-12
publish-runtime-id: osx-x64
runs-on: ${{ matrix.environment }}
steps:
- uses: olegtarasov/[email protected]
id: tagName
- name: Avoid git mutating files on checkout
run: |
git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.203'
- name: Try use dotnet
run: dotnet --info
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
run: dotnet clean ./implement/test-elm-time/test-elm-time.csproj && dotnet nuget locals all --clear
- name: dotnet publish
run: dotnet publish -c Debug -r ${{ matrix.publish-runtime-id }} --self-contained true -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true --output ./dotnet-build ./implement/elm-time
- name: Copy artifacts to publish
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path "./publish";
Get-ChildItem -Path "./dotnet-build/" -Filter "elm-time*" | ForEach-Object { Copy-Item -Path $_.FullName -Destination "./publish/" }
- name: Publish artifacts
uses: actions/upload-artifact@v4
with:
name: elm-time-bin-${{ steps.tagName.outputs.tag }}-${{ matrix.publish-runtime-id }}
path: ./publish