From 790f0cfb20686246bb24cdf154dbb2bf2f7d6a59 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Fri, 23 Aug 2024 11:22:25 +0200 Subject: [PATCH] work on github build --- .github/workflows/build-pull.yml | 27 ++++++++++++++ .github/workflows/build.yml | 28 +++++++++++++++ .github/workflows/release.yml | 47 +++++++++++++++++++++++++ appveyor.yml | 60 -------------------------------- 4 files changed, 102 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/build-pull.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/build-pull.yml b/.github/workflows/build-pull.yml new file mode 100644 index 00000000..b376949a --- /dev/null +++ b/.github/workflows/build-pull.yml @@ -0,0 +1,27 @@ +name: .NET Pull Request + +on: + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: | + dotnet restore src/S7CommPlusDriver + dotnet restore src/DriverTest + dotnet restore src/S7CommPlusGUIBrowser + - name: Build + run: | + dotnet build src/S7CommPlusDriver + dotnet build src/DriverTest + dotnet build src/S7CommPlusGUIBrowser diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a72f11b1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: .NET + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Fetch history + run: git fetch --prune --unshallow + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 5.0.x + 6.0.x + 8.0.x + - name: Restore dependencies + run: dotnet restore DotNetSiemensPLCToolBoxLibrary.sln + - name: Build + run: dotnet build DotNetSiemensPLCToolBoxLibrary.sln \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..1e0dbea1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: .NET + +on: + release: + types: [published] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Fetch history + run: git fetch --prune --unshallow + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: | + dotnet restore src/S7CommPlusDriver + dotnet restore src/DriverTest + dotnet restore src/S7CommPlusGUIBrowser + + - name: Update project version + uses: roryprimrose/set-vs-sdk-project-version@v1 + with: + version: ${{ github.event.release.tag_name }} + assemblyVersion: ${{ github.event.release.tag_name }} + fileVersion: ${{ github.event.release.tag_name }} + informationalVersion: ${{ github.event.release.tag_name }}-${{ github.sha }} + + - name: Build + run: | + dotnet build src/S7CommPlusDriver + dotnet build src/DriverTest + dotnet build src/S7CommPlusGUIBrowser + + - name: Publish NuGet + # You may pin to the exact commit or the version. + # uses: brandedoutcast/publish-nuget@c12b8546b67672ee38ac87bea491ac94a587f7cc + uses: brandedoutcast/publish-nuget@v2.5.5 + with: + # Filepath of the project to be packaged, relative to root of repository + PROJECT_FILE_PATH: MonacoRoslynCompletionProvider/MonacoRoslynCompletionProvider/MonacoRoslynCompletionProvider.csproj + NUGET_KEY: ${{secrets.NUGET_API_KEY}} diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 76b131af..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,60 +0,0 @@ -image: Visual Studio 2019 - -version: 4.0.{build} - -branches: - only: - - master - -dotnet_csproj: - patch: true - file: '**\*.csproj' - version: '{version}' - package_version: '{version}' - assembly_version: '{version}' - file_version: '{version}' - informational_version: '{version}' - -configuration: Debug - -install: - - cmd: choco install dotnetcore-sdk --pre - -before_build: - - cmd.exe /c externalDlls\libnodave\vcwinmake_64.bat - - cmd.exe /c externalDlls\libnodave\vcwinmake.bat - - externalDlls\copydlls.bat - - nuget restore - -build: - project: DotNetSiemensPLCToolBoxLibrary.sln - -after_build: - - 7z a TiaGitHandler.zip %APPVEYOR_BUILD_FOLDER%\TiaGitHandler\bin\Debug\net48\*.* - - 7z a WPFVarTab.zip %APPVEYOR_BUILD_FOLDER%\WPFVarTab\bin\Debug\net462\*.* - - 7z a Protokoller.zip %APPVEYOR_BUILD_FOLDER%\DotNetDatenbankProtokollerV2\DotNetSimaticDatabaseProtokollerService\bin\Debug\net462\*.* - - 7z a S7ToolBox.zip %APPVEYOR_BUILD_FOLDER%\TestProjectFileFunctions\bin\Debug\net48\*.* - -artifacts: - - path: externalDlls\libnodave\libnodave_jfkmod.dll - name: libnodave_jfkmod.dll - - path: externalDlls\libnodave\libnodave_jfkmod64.dll - name: libnodave_jfkmod64.dll - - path: '**\DotNetSiemensPLCToolBoxLibrary*.*nupkg' - - path: TiaGitHandler.zip - name: TiaGitHandler - - path: S7ToolBox.zip - name: S7ToolBox - - path: WPFVarTab.zip - name: WPFVarTab - - path: Protokoller.zip - name: Protokoller - -deploy: - provider: NuGet - api_key: - secure: qGLYnLmoAwOz2buRk5Nx5ouhilFDBQf8ktSQ0+EDKPKNUq/xmbfM1kWKt9c1O8YI - artifact: /.*DotNetProjects\.DotNetSiemensPLCToolBoxLibrary.*nupkg/ - - -