Skip to content

Commit

Permalink
Merge pull request #3 from SergeyLadanov/new_dotnet
Browse files Browse the repository at this point in the history
New dotnet
  • Loading branch information
SergeyLadanov authored Oct 27, 2023
2 parents dcebfcc + c8e4b59 commit 8b225b3
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 186 deletions.
34 changes: 34 additions & 0 deletions .gitea/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build dotnet

on:
push:
branches: '*'
pull_request:
branches: '*'
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout repository
- name: Checkout code
uses: actions/checkout@v3

- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Build
run: dotnet publish CPL_Converter.csproj -c Release -o CPL_Converter -r win-x64 --self-contained false /p:EnableWindowsTargeting=true /p:FileVersion=$GITHUB_REF_NAME

- name: Tar files
run: tar -cvf Build_Output.tar CPL_Converter

- name: Upload artifatcs
uses: actions/upload-artifact@v3
with:
name: Build_Output.tar
path: |
Build_Output.tar
40 changes: 40 additions & 0 deletions .gitea/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release project

on:
push:
tags:
- '*'

jobs:
build:
name: Building project
uses: ./.gitea/workflows/build.yml
upload:
name: Uploading files
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifatcs
uses: actions/download-artifact@v3
with:
name: Build_Output.tar

- name: Rename output files
run: mv Build_Output.tar/Build_Output.tar CPL_Converter_$GITHUB_REF_NAME.tar

- name: List of files
run: ls

- name: setup go
uses: https://github.com/actions/setup-go@v4
with:
go-version: '>=1.20.1'


- name: Use Go Action
id: use-go-action
uses: https://gitea.com/actions/release-action@main
with:
files: |-
CPL_Converter_*.tar
api_key: '${{secrets.RELEASE_TOKEN}}'
28 changes: 16 additions & 12 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@ on:
branches: '*'
pull_request:
branches: '*'

workflow_call:

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
- uses: actions/checkout@v3

- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- name: Restore dependencies
run: dotnet restore
dotnet-version: 6.0.x

- name: Build
run: MSBuild CPL_Converter.csproj /p:Configuration=Release
- name: Test
run: dotnet test --no-build --verbosity normal
run: dotnet publish CPL_Converter.csproj -c Release -o CPL_Converter/CPL_Converter -r win-x64 --self-contained false /p:EnableWindowsTargeting=true /p:FileVersion=$GITHUB_REF_NAME

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: Build_Output
path: |
CPL_Converter
56 changes: 29 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
name: Release
name: Release project

on:
push:
tags:
- '*'

jobs:
jobs:
build:

runs-on: windows-latest

name: Building project
uses: ./.github/workflows/dotnet.yml
upload:
name: Uploading files
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- name: Restore dependencies
run: dotnet restore
- name: Build
run: MSBuild CPL_Converter.csproj /p:Configuration=Release
- name: Test
run: dotnet test --no-build --verbosity normal


- name: Upload bin to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/Release/CPL_Converter.exe
asset_name: CPL_Converter_$tag.exe
tag: ${{ github.ref }}
- name: Download build artifatcs
uses: actions/download-artifact@v3
with:
name: Build_Output
- name: List of files
run: ls


- name: ZIP files
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: 'release.zip'

- name: Upload bin to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: release.zip
asset_name: CPL_Converter_$tag.zip
tag: ${{ github.ref }}
117 changes: 12 additions & 105 deletions CPL_Converter.csproj
Original file line number Diff line number Diff line change
@@ -1,118 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C04F2BE8-3B9D-43B0-86BE-AFA04EA83908}</ProjectGuid>
<TargetFramework>net6.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<RootNamespace>CPL_Converter</RootNamespace>
<AssemblyName>CPL_Converter</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>formIcon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Office.Interop.Excel.15.0.4795.1000\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CplConverter.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<COMReference Include="Microsoft.Office.Core">
<Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>8</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="VBIDE">
<Guid>{0002E157-0000-0000-C000-000000000046}</Guid>
<VersionMajor>5</VersionMajor>
<VersionMinor>3</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<Content Include="formIcon.ico" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Office.Interop.Excel" Version="15.0.4795.1001" />
<PackageReference Include="Open-XML-SDK" Version="2.9.1" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions CPL_Converter.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30611.23
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPL_Converter", "CPL_Converter.csproj", "{C04F2BE8-3B9D-43B0-86BE-AFA04EA83908}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPL_Converter", "CPL_Converter.csproj", "{C04F2BE8-3B9D-43B0-86BE-AFA04EA83908}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
12 changes: 12 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;

Expand All @@ -11,6 +12,17 @@ static class Program
/// <summary>
/// Главная точка входа для приложения.
/// </summary>


[DllImport("kernel32.dll")]
public static extern bool FreeConsole();


static Program()
{
FreeConsole();
}

[STAThread]
static void Main()
{
Expand Down
36 changes: 0 additions & 36 deletions Properties/AssemblyInfo.cs

This file was deleted.

4 changes: 0 additions & 4 deletions packages.config

This file was deleted.

0 comments on commit 8b225b3

Please sign in to comment.