Skip to content

.NET-Draft-Release-Desktop #18

.NET-Draft-Release-Desktop

.NET-Draft-Release-Desktop #18

name: .NET-Draft-Release-Desktop
on:
workflow_dispatch:
inputs:
name:
description: 'Version number'
required: true
prerelease:
description: 'Prerelease'
required: true
type: boolean
default: false
env:
PROJECT_PATH: ./BugFablesSaveEditor/BugFablesSaveEditor.Desktop
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: windows-latest
rid: win-x64
buildName: Windows
- os: ubuntu-latest
rid: linux-x64
buildName: Linux
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Install wasm-tools
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build
- name: Publish
working-directory: ${{ env.PROJECT_PATH }}
run: dotnet publish -f net8.0 -o publish -r ${{ matrix.rid }}
- name: Prepare Publish Directory
working-directory: ${{ env.PROJECT_PATH }}
run: |
cp ../../LICENSE publish
cp ../../README.md publish
- name: Archive Release
uses: thedoctor0/zip-release@main
with:
filename: ${{ github.event.repository.name }}-${{ matrix.buildName }}.zip
directory: ${{ env.PROJECT_PATH }}/publish
exclusions: '*.pdb *.dbg'
- name: Upload Artifact
uses: actions/[email protected]
with:
name: ${{ github.event.repository.name }}-${{ matrix.buildName }}
path: ${{ env.PROJECT_PATH }}/publish/${{ github.event.repository.name }}-${{ matrix.buildName }}.zip
if-no-files-found: error
release:
needs: build
concurrency:
group: "draft-release"
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Draft Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ inputs.name }}
name: Version ${{ inputs.name }}
files: artifacts/**/*.zip
prerelease: ${{ inputs.prerelease }}
draft: true
fail_on_unmatched_files: true