Skip to content

Commit a5ea477

Browse files
committed
Added api keys to appveyor.yml
1 parent b6b0176 commit a5ea477

File tree

2 files changed

+110
-16
lines changed

2 files changed

+110
-16
lines changed

appveyor.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
version: 1.0.{build}
22
image: Visual Studio 2017
3+
4+
install:
5+
- cmd: choco install dotnet.script
6+
37
build_script:
4-
- ps: >-
5-
cd .\build\
8+
- cmd: >-
9+
cd build
610
7-
.\install-dotnet-script.ps1
8-
- cmd:
9-
dotnet .\dotnet-script\dotnet-script.dll build.csx
11+
refreshenv
12+
13+
dotnet script build.csx
1014
11-
test: off
1215
artifacts:
13-
- path: /**/Dotnet.Script*.nupkg
16+
- path: build\Artifacts\Chocolatey\*.nupgk
1417
name: Chocolatey Packages
15-
# Uncomment this to enable deploy on repo tagging
16-
# deploy:
17-
# provider: Chocolatey
18-
# api_key:
19-
# secure: [Your API key goes here]
20-
# skip_symbols: false
21-
# artifact: /.*\.nupkg/
22-
# on:
23-
# appveyor_repo_tag: true
18+
19+
- path: build\Artifacts\NuGet\*.nupgk
20+
name: NuGet Packages
21+
22+
- path: build\Artifacts\GitHub\*.zip
23+
name: GitHub
24+
25+
test: off
26+
environment:
27+
IS_SECURE_BUILDENVIRONM∥ENT:
28+
secure: The encoded value of 'true' (not including the apostrophes)
29+
GITHUB_REPO_TOKEN:
30+
secure: The encoded value of your GitHub Access Token.
31+
NUGET_APIKEY:
32+
secure: The encoded value of your NuGet ApiKey.
33+
CHOCO_APIKEY:
34+
secure: The encoded value of the Choco API Key (dotnet-script account).

build/BuildContext.csx

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#load "nuget:Dotnet.Build, 0.2.7"
2+
using static FileUtils;
3+
using System.Xml.Linq;
4+
5+
public static class BuildContext
6+
{
7+
static BuildContext()
8+
{
9+
Owner = "filipw";
10+
ProjectName = "dotnet-script";
11+
Root = FileUtils.GetScriptFolder();
12+
13+
DotnetScriptProjectFolder = Path.Combine(Root, "..", "src", "Dotnet.Script");
14+
DotnetScriptCoreProjectFolder = Path.Combine(Root, "..", "src", "Dotnet.Script.Core");
15+
DotnetScriptDependencyModelProjectFolder = Path.Combine(Root, "..", "src", "Dotnet.Script.DependencyModel");
16+
DotnetScriptDependencyModelNuGetProjectFolder = Path.Combine(Root, "..", "src", "Dotnet.Script.DependencyModel.NuGet");
17+
18+
var artifactsFolder = CreateDirectory(Root, "Artifacts");
19+
GitHubArtifactsFolder = CreateDirectory(artifactsFolder, "GitHub");
20+
NuGetArtifactsFolder = CreateDirectory(artifactsFolder, "NuGet");
21+
ChocolateyArtifactsFolder = CreateDirectory(artifactsFolder, "Chocolatey");
22+
PublishArtifactsFolder = CreateDirectory(artifactsFolder, "Publish", ProjectName);
23+
PublishArchiveFolder = Path.Combine(PublishArtifactsFolder, "..");
24+
//PublishArtifactsFolder = CreateDirectory(artifactsFolder, "Publish", ProjectName);
25+
26+
PathToReleaseNotes = Path.Combine(GitHubArtifactsFolder, "ReleaseNotes.md");
27+
28+
Version = ReadVersion();
29+
30+
PathToGitHubReleaseAsset = Path.Combine(GitHubArtifactsFolder, $"{ProjectName}.{Version}.zip");
31+
32+
string ReadVersion()
33+
{
34+
var projectFile = XDocument.Load(Directory.GetFiles(DotnetScriptProjectFolder, "*.csproj").Single());
35+
var versionPrefix = projectFile.Descendants("VersionPrefix").SingleOrDefault()?.Value;
36+
var versionSuffix = projectFile.Descendants("VersionSuffix").SingleOrDefault()?.Value;
37+
38+
if (versionSuffix != null)
39+
{
40+
return $"{versionPrefix}-{versionSuffix}";
41+
}
42+
else
43+
{
44+
return versionPrefix;
45+
}
46+
}
47+
}
48+
49+
private static string Version { get; }
50+
51+
public static string GitHubArtifactsFolder { get; }
52+
53+
public static string GitHubReleaseAsset { get; }
54+
55+
public static string GitHubReleaseNoteAsset { get; }
56+
57+
public static string NuGetArtifactsFolder { get; }
58+
59+
public static string ChocolateyArtifactsFolder { get; }
60+
61+
public static string PublishArtifactsFolder { get; }
62+
63+
public static string PublishArchiveFolder { get; }
64+
65+
public static string DotnetScriptProjectFolder { get; }
66+
67+
public static string DotnetScriptCoreProjectFolder { get; }
68+
69+
public static string DotnetScriptDependencyModelProjectFolder { get; }
70+
71+
public static string DotnetScriptDependencyModelNuGetProjectFolder { get; }
72+
73+
public static string Root { get; }
74+
75+
76+
public static string TestProjectFolder { get; }
77+
78+
public static string PathToReleaseNotes { get; }
79+
80+
public static string PathToGitHubReleaseAsset { get; }
81+
public static string Owner { get; }
82+
public static string ProjectName { get; }
83+
}

0 commit comments

Comments
 (0)