Skip to content
Permalink
Browse files

adds CI/CD by appveyor

- add interop dll to support Playsafe login
- use ILMerge to package dlls
- setup appveyor setting on yaml file
  • Loading branch information...
xnum committed Nov 3, 2018
1 parent b4cddb3 commit fefb71532e0968ca4a35eb1f66a5de47070aa23d
@@ -6,11 +6,11 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpAnalytics.Net45", "CSharpAnalytics\Source\CSharpAnalytics\CSharpAnalytics.Net45.csproj", "{0334B071-1FB1-4372-B500-4BC58A11EE59}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpAnalytics.Net45", "CSharpAnalytics\Source\CSharpAnalytics\CSharpAnalytics.Net45.csproj", "{0334B071-1FB1-4372-B500-4BC58A11EE59}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeanfunLogin", "BeanfunLogin\BeanfunLogin.csproj", "{AE885E1D-D21F-4810-9F82-EF797DD7845A}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeanfunLogin", "BeanfunLogin\BeanfunLogin.csproj", "{AE885E1D-D21F-4810-9F82-EF797DD7845A}"
ProjectSection(ProjectDependencies) = postProject
{0334B071-1FB1-4372-B500-4BC58A11EE59} = {0334B071-1FB1-4372-B500-4BC58A11EE59}
EndProjectSection
EndProject EndProject
Global Global
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props" Condition="Exists('..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -28,6 +29,8 @@
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
@@ -39,6 +42,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
@@ -78,6 +82,16 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\CSharpAnalytics\Binaries\Debug\Net45\CSharpAnalytics.Net45.dll</HintPath> <HintPath>..\CSharpAnalytics\Binaries\Debug\Net45\CSharpAnalytics.Net45.dll</HintPath>
</Reference> </Reference>
<Reference Include="Interop.FSFISCATLLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>False</EmbedInteropTypes>
<HintPath>.\Interop.FSFISCATLLib.dll</HintPath>
</Reference>
<Reference Include="Interop.FSP11CRYPTATLLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>False</EmbedInteropTypes>
<HintPath>.\Interop.FSP11CRYPTATLLib.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
@@ -147,6 +161,7 @@
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<None Include="BeanfunLogin_TemporaryKey.pfx" /> <None Include="BeanfunLogin_TemporaryKey.pfx" />
<None Include="ILMerge.props" />
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Properties\app.manifest" /> <None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
@@ -165,6 +180,7 @@
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="ILMergeOrder.txt" />
<Content Include="ms2.ico" /> <Content Include="ms2.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -210,26 +226,66 @@
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<COMReference Include="FSFISCATLLib"> <PublishFile Include="CSharpAnalytics.Net45">
<Guid>{575E33A5-A206-4984-89F9-0DCC95888347}</Guid> <Visible>False</Visible>
<VersionMajor>1</VersionMajor> <Group>
<VersionMinor>0</VersionMinor> </Group>
<Lcid>0</Lcid> <TargetPath>
<WrapperTool>tlbimp</WrapperTool> </TargetPath>
<Isolated>False</Isolated> <PublishState>Include</PublishState>
<EmbedInteropTypes>False</EmbedInteropTypes> <IncludeHash>True</IncludeHash>
</COMReference> <FileType>Assembly</FileType>
<COMReference Include="FSP11CRYPTATLLib"> </PublishFile>
<Guid>{8CEC7D8F-9617-4F01-BF12-3F435955325A}</Guid> <PublishFile Include="Interop.FSFISCATLLib">
<VersionMajor>1</VersionMajor> <Visible>False</Visible>
<VersionMinor>0</VersionMinor> <Group>
<Lcid>0</Lcid> </Group>
<WrapperTool>tlbimp</WrapperTool> <TargetPath>
<Isolated>False</Isolated> </TargetPath>
<EmbedInteropTypes>False</EmbedInteropTypes> <PublishState>Include</PublishState>
</COMReference> <IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="Interop.FSP11CRYPTATLLib">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="ms2.ico">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>File</FileType>
</PublishFile>
<PublishFile Include="Newtonsoft.Json">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>此專案參考這部電腦上所缺少的 NuGet 封裝。請啟用 NuGet 封裝還原,以下載該封裝。如需詳細資訊,請參閱 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的檔案是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props'))" />
<Error Condition="!Exists('..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets'))" />
</Target>
<Import Project="..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets" Condition="Exists('..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
@@ -45,21 +45,19 @@ public partial class main : Form


private CSharpAnalytics.Activities.AutoTimedEventActivity timedActivity = null; private CSharpAnalytics.Activities.AutoTimedEventActivity timedActivity = null;


private string currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); private Version currentVersion = Assembly.GetExecutingAssembly().GetName().Version;


private GamePathDB gamePaths = new GamePathDB(); private GamePathDB gamePaths = new GamePathDB();


public main() public main()
{ {
currentVersion = currentVersion.Remove(currentVersion.Length - 2);

if (Properties.Settings.Default.GAEnabled) if (Properties.Settings.Default.GAEnabled)
{ {
try try
{ {
AutoMeasurement.Instance = new WinFormAutoMeasurement(); AutoMeasurement.Instance = new WinFormAutoMeasurement();
AutoMeasurement.DebugWriter = d => Debug.WriteLine(d); AutoMeasurement.DebugWriter = d => Debug.WriteLine(d);
AutoMeasurement.Start(new MeasurementConfiguration("UA-75983216-4", Assembly.GetExecutingAssembly().GetName().Name, currentVersion)); AutoMeasurement.Start(new MeasurementConfiguration("UA-75983216-4", Assembly.GetExecutingAssembly().GetName().Name, currentVersion.ToString()));
} }
catch catch
{ {
@@ -312,8 +310,8 @@ public void CheckForUpdate()
if (!regex.IsMatch(response)) if (!regex.IsMatch(response))
return; return;
string versionStr = regex.Match(response).Groups[1].Value; string versionStr = regex.Match(response).Groups[1].Value;

Version webVersion = new Version(versionStr);
if (versionStr != Properties.Settings.Default.IgnoreVersion && versionStr != currentVersion) if (versionStr != Properties.Settings.Default.IgnoreVersion && webVersion > currentVersion)
{ {
Properties.Settings.Default.IgnoreVersion = versionStr; Properties.Settings.Default.IgnoreVersion = versionStr;
Properties.Settings.Default.Save(); Properties.Settings.Default.Save();
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- -->
<!-- ILMerge project-specific settings. Almost never need to be set explicitly. -->
<!-- for details, see http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx -->
<!-- -->
<!-- *** set this file to Type=None, CopyToOutput=Never *** -->

<!-- If True, all copy local dependencies will also be merged from referenced projects whether they are referenced in the current project explicitly or not -->
<ILMergeTransitive>true</ILMergeTransitive>

<!-- Extra ILMerge library paths (semicolon-separated). Dont put your package dependencies here, they will be added automagically -->
<ILMergeLibraryPath></ILMergeLibraryPath>

<!-- The solution NuGet package directory if not standard 'SOLUTION\packages' -->
<ILMergePackagesPath></ILMergePackagesPath>

<!-- The merge order file name if differs from standard 'ILMergeOrder.txt' -->
<ILMergeOrderFile></ILMergeOrderFile>

<!-- The strong key file name if not specified in the project -->
<ILMergeKeyFile></ILMergeKeyFile>

<!-- The assembly version if differs for the version of the main assembly -->
<ILMergeAssemblyVersion></ILMergeAssemblyVersion>

<!-- added in Version 1.0.4 -->
<ILMergeFileAlignment></ILMergeFileAlignment>

<!-- added in Version 1.0.4, default=none -->
<ILMergeAllowDuplicateType></ILMergeAllowDuplicateType>

<!-- If the <see cref="CopyAttributes"/> is also set, any assembly-level attributes names that have the same type are copied over into the target assembly -->
<ILMergeAllowMultipleAssemblyLevelAttributes></ILMergeAllowMultipleAssemblyLevelAttributes>

<!-- See ILMerge documentation -->
<ILMergeAllowZeroPeKind></ILMergeAllowZeroPeKind>

<!-- The assembly level attributes of each input assembly are copied over into the target assembly -->
<ILMergeCopyAttributes></ILMergeCopyAttributes>

<!-- Creates a .pdb file for the output assembly and merges into it any .pdb files found for input assemblies, default=true -->
<ILMergeDebugInfo></ILMergeDebugInfo>

<!-- Target assembly will be delay signed -->
<ILMergeDelaySign></ILMergeDelaySign>

<!-- Types in assemblies other than the primary assembly have their visibility modified -->
<ILMergeInternalize></ILMergeInternalize>

<!-- The path name of the file that will be used to identify types that are not to have their visibility modified -->
<ILMergeInternalizeExcludeFile></ILMergeInternalizeExcludeFile>

<!-- XML documentation files are merged to produce an XML documentation file for the target assembly -->
<ILMergeXmlDocumentation></ILMergeXmlDocumentation>

<!-- External assembly references in the manifest of the target assembly will use full public keys (false) or public key tokens (true, default value) -->
<ILMergePublicKeyTokens></ILMergePublicKeyTokens>

<!-- Types with the same name are all merged into a single type in the target assembly -->
<ILMergeUnionMerge></ILMergeUnionMerge>

<!-- The version of the target framework, default 40 (works for 45 too) -->
<ILTargetPlatform></ILTargetPlatform>
</PropertyGroup>
</Project>
@@ -0,0 +1,4 @@
# this file contains the partial list of the merged assemblies in the merge order
# you can fill it from the obj\CONFIG\PROJECT.ilmerge generated on every build
# and finetune merge order to your satisfaction

Binary file not shown.
Binary file not shown.
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="ILMerge" version="2.13.0307" targetFramework="net45" />
<package id="MSBuild.ILMerge.Task" version="1.0.5" targetFramework="net45" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" /> <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
</packages> </packages>
@@ -0,0 +1,37 @@
version: '{build}'
pull_requests:
do_not_increment_build_number: true
skip_non_tags: true
platform: Any CPU
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: $(appveyor_repo_tag_name).{build}
assembly_file_version: $(appveyor_repo_tag_name).{build}
assembly_informational_version: $(appveyor_repo_tag_name).{build}
before_build:
- cmd: >-
git submodule init
git submodule update
nuget restore
build:
project: BeanfunLogin.sln
verbosity: minimal
before_package:
- cmd: >-
move BeanfunLogin\bin\Debug\BeanfunLogin.exe BeanfunLogin.exe
7z a BeanfunLogin-v%APPVEYOR_REPO_TAG_NAME%.zip BeanfunLogin.exe
artifacts:
- path: BeanfunLogin-*.zip
name: BeanfunLogin
deploy:
- provider: GitHub
release: $(appveyor_repo_tag_name)
auth_token:
secure: cQZ4LdC6ouImg7hZpXhi44OLcMjrD+tmowA5MDwNeMXmVO9P/sUtUU5/EJVxt253
draft: false
on:
appveyor_repo_tag: true

0 comments on commit fefb715

Please sign in to comment.
You can’t perform that action at this time.