Beispiel #1
0
        public static void Publish(DotnetOptions o)
        {
            var dirty = Git("status --porcelain").Length > 0;

            if (dirty)
            {
                throw new BuildException(
                    "Publishing uncommited changes is not allowed");
            }

            Clean(o);
            Build(o);

            var version = FetchVersion();
            var commitId = Git("rev-parse --short HEAD");

            foreach (var runtime in new[] { "win-x64", "linux-x64" })
            {
                var directory = Path.Combine(
                    ArtifactsDirectory,
                    version,
                    runtime);

                Dotnet(
                    "publish src/Chunkyard",
                    $"-c {o.Configuration}",
                    $"-r {runtime}",
                    $"-o {directory}",
                    $"-p:Version={version}",
                    $"-p:SourceRevisionId={commitId}",
                    "-p:PublishSingleFile=true",
                    "-p:PublishTrimmed=true",
                    "-p:TrimMode=Link");
            }
        }
Beispiel #2
0
        public static void Clean(DotnetOptions o)
        {
            Dotnet(
                $"clean {Solution}",
                $"-c {o.Configuration}");

            CleanDirectory(ArtifactsDirectory);
        }
Beispiel #3
0
        public static void Build(DotnetOptions o)
        {
            Dotnet(
                $"format {Solution}",
                "--check");

            Dotnet(
                $"build {Solution}",
                $"-c {o.Configuration}",
                "-warnaserror");

            Dotnet(
                $"test {Solution}",
                "--no-build",
                $"-c {o.Configuration}");
        }