pipeline {
    agent any
    tools {
        dotnetsdk 'dotnet7'
    }
    stages {
        stage('clean old'){
            steps{
                sh 'rm -rf bin obj'
            }
        }
        stage('linux') {
            steps {
                sh 'dotnet publish --configuration Release --os linux'
                archiveArtifacts artifacts: 'bin/Release/net7.0/linux-x64/publish/*.*'
            }
        }
        stage('windows') {
            steps {
                sh 'dotnet publish --configuration Release --os windows'
                archiveArtifacts artifacts: 'bin/Release/net7.0/windows-x64/publish/*.*'
            }
        }
    }
}