Hey ho! If you need help setting up one of my Projects, join the Discord server at https://discord.gg/Cf6sspj

AppVeyor

From Lemon
Revision as of 22:16, 2 April 2020 by Lemon (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The logo of AppVeyor

AppVeyor is a Continuous Integration service that allows GitHub projects to be built in Windows Virtual Machines. It is used in almost all of my projects written in C#, so I make sure that they can be compiled before releasing them.

Configuration Templates

This is the base of all of my AppVeyor configuration files. If you plan to use it, make sure to change the highlighted lines with your own encrypted tokens.

 1 # WARNING: We expect the Solution to be named exactly like the AppVeyor project
 2 # For example: A project called NewProject needs a solution called NewProject.sln
 3 
 4 # The Version to use and the Build Image
 5 version: "1.0.0.{build}"
 6 image: Visual Studio 2017
 7 
 8 # This triggers a webhook to #appveyor on Discord with SkyHook
 9 # https://github.com/Commit451/skyhook
10 notifications:
11   - provider: Webhook
12     url:
13       secure: >
14         RQOjbD0a6023xZNVZ7zzk7PjRpoF448yAGSM8koDLhmkmzUM5yPCgmaad8aJqIs8
15         RUNIyviWWVKgyVoHDnXu54LGOTNVOCWgVLopKG8FA/Ofnc/R3wb8e0Y1VLME2TDc
16         4OyE8nUxd78/lJY7qiz0pR1OZDgDregNYwczlizdDJNHSumbS17VNKQygVqdwoqd
17 
18 # This patches the AssemblyInfo.cs for old csproj files
19 assembly_info:
20   patch: true
21   file: Properties\AssemblyInfo.cs
22   assembly_version: "{version}"
23   assembly_file_version: "{version}"
24 
25 # Ditto, but for new csproj files (VS 2017 and newer)
26 dotnet_csproj:
27   patch: true
28   file: '**\*.csproj'
29   version: "{version}"
30   package_version: "{version}"
31   assembly_version: "{version}"
32   file_version: "{version}"
33   informational_version: "{version}"
34 
35 # If this build is from a tag, use the tag as the version without the V at the start
36 init:
37   - ps: if ($env:APPVEYOR_REPO_TAG -eq "true") { Update-AppveyorBuild -Version "$($env:APPVEYOR_REPO_TAG_NAME.TrimStart("v"))" }
38 
39 # Restore Git Submodules and NuGet Packages
40 install:
41   - git submodule update --init --recursive
42   - nuget restore %APPVEYOR_PROJECT_NAME%.sln
43 
44 # Build the solution with the same name as the AppVeyor project
45 build_script:
46   - msbuild %APPVEYOR_PROJECT_NAME%.sln /t:Build /p:Configuration=Release
47 
48 # After building everything, package it in a 7zip and upload it as an Artifact
49 after_build:
50   - 7z a %APPVEYOR_PROJECT_NAME%.7z %APPVEYOR_BUILD_FOLDER%\bin\Release\*
51   - appveyor PushArtifact %APPVEYOR_PROJECT_NAME%.7z
52 
53 # If this is a tag, deploy the 7zip file(s) to GitHub Releases
54 deploy:
55   release: v$(APPVEYOR_BUILD_VERSION)
56   provider: GitHub
57   auth_token:
58     secure: "DkvKC8KRj8AipGu/oWW/J2e6jMWt2xXQfKU7oefFMsp0ZMfzz+OR9Y9XpML+ZmG4"
59   artifact: /.*\.7z/
60   draft: false
61   prerelease: false
62   on:
63     branch: master
64     appveyor_repo_tag: true