From 19fdf9ea400271c11aad6f6e4dba1b46edc0407a Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Wed, 15 May 2024 13:48:24 +0100 Subject: [PATCH] add back posting version --- .github/workflows/main.yml | 12 ++++++++++++ Build/EnvFile.cs | 32 -------------------------------- Build/Github.cs | 4 ++-- Build/Program.cs | 3 ++- 4 files changed, 16 insertions(+), 35 deletions(-) delete mode 100644 Build/EnvFile.cs diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 657024391d..61bda831b9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,3 +53,15 @@ jobs: VERSION: ${{ env.fullSemVer }} run: ./build.ps1 build + - name: Pack + run: ./build.ps1 zip + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: output.zip + path: output/*.* + compression-level: 0 # no compression + + - name: Trigger Build Installers + run: ./build.ps1 build-installers ${{ secrets.CONNECTORS_GH_TOKEN }} ${{ github.run_id }} ${{ env.fullSemVer }} diff --git a/Build/EnvFile.cs b/Build/EnvFile.cs deleted file mode 100644 index 0734d8dfb9..0000000000 --- a/Build/EnvFile.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Build; - -public static class EnvFile -{ - public static Dictionary Parse(string path) - { - Dictionary data = new(); - - if (!File.Exists(path)) - { - throw new FileNotFoundException(path); - } - - using var reader = File.OpenText(path); - while (reader.ReadLine() is { } line) - { - var values = line.Split("=", StringSplitOptions.RemoveEmptyEntries); - if (values.Length < 2) - { - continue; - } - data.Add(values[0], string.Join('=', values.Skip(1))); - } - - return data; - } -} diff --git a/Build/Github.cs b/Build/Github.cs index 88624baf99..5d3267937e 100644 --- a/Build/Github.cs +++ b/Build/Github.cs @@ -9,10 +9,10 @@ namespace Build; public static class Github { - public static async Task BuildInstallers(string token, string runId) + public static async Task BuildInstallers(string token, string runId, string version) { using var client = new HttpClient(); - var payload = new { event_type = "build-installers", client_payload = new { run_id = runId } }; + var payload = new { event_type = "build-installers", client_payload = new { run_id = runId, version } }; var content = new StringContent( JsonSerializer.Serialize(payload), new MediaTypeHeaderValue(MediaTypeNames.Application.Json) diff --git a/Build/Program.cs b/Build/Program.cs index a71bd15828..bd78720c24 100644 --- a/Build/Program.cs +++ b/Build/Program.cs @@ -133,7 +133,8 @@ IEnumerable GetFiles(string d) { var token = arguments.First(); var runId = arguments.Skip(1).First(); - await Github.BuildInstallers(token, runId).ConfigureAwait(false); + var version = arguments.Skip(2).First(); + await Github.BuildInstallers(token, runId, version).ConfigureAwait(false); } );