Skip to content

Update dotnet.yml

Update dotnet.yml #29

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get project version
uses: lllggghhhaaa/WaxDotnetVersionFinder@2.0.1
id: project-version
with:
path: /home/runner/work/WaxMapArt/WaxMapArt/WaxMapArt.Avalonia.Desktop/WaxMapArt.Avalonia.Desktop.csproj
- name: Create a Release
uses: elgohr/Github-Release-Action@v5
env:
GITHUB_TOKEN: ${{ github.token }}
with:
title: ${{ steps.project-version.outputs.version }}
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8
- name: Restore dependencies
run: dotnet restore
- name: Publish win-x64
run: dotnet publish /home/runner/work/WaxMapArt/WaxMapArt/WaxMapArt.Avalonia.Desktop/WaxMapArt.Avalonia.Desktop.csproj -r win-x64 -c Release -o publish/win-x64 --sc
- name: Publish linux-x64
run: dotnet publish /home/runner/work/WaxMapArt/WaxMapArt/WaxMapArt.Avalonia.Desktop/WaxMapArt.Avalonia.Desktop.csproj -r linux-x64 -c Release -o publish/linux-x64 --sc
- name: Create Folder
run: |
mkdir /home/runner/work/WaxMapArt/WaxMapArt/publish/artifacts/
- name: Zip win-x64
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: 'artifacts/win-x64.zip'
directory: /home/runner/work/WaxMapArt/WaxMapArt/publish/
path: win-x64
- name: Zip linux-x64
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: 'artifacts/linux-x64.zip'
directory: /home/runner/work/WaxMapArt/WaxMapArt/publish/
path: linux-x64
- name: Upload Release Asset win-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/WaxMapArt/WaxMapArt/publish/artifacts/win-x64.zip
asset_name: WaxMapArt.Desktop-win-x64.zip
asset_content_type: application/zip
- name: Upload Release Asset linux-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/WaxMapArt/WaxMapArt/publish/artifacts/linux-x64.zip
asset_name: WaxMapArt.Desktop-linux-x64.zip
asset_content_type: application/zip