Skip to content

Commit beccc3c

Browse files
committed
move to later runtime deps image
1 parent 27519fa commit beccc3c

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ jobs:
9595

9696
- name: Publish AOT
9797
run: dotnet run --project build -c release -- publishbinaries
98+
99+
- name: Publish Containers
100+
if: ${{ matrix.os == 'ubuntu-latest' }}
101+
run: dotnet run --project build -c release -- publishcontainers
98102

99103
integration:
100104
if: false

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
password: ${{ secrets.GITHUB_TOKEN }}
6868

6969
- name: Publish Containers
70-
run: ./build.sh publishcontainers\
70+
run: ./build.sh publishcontainers
7171

7272
build-lambda:
7373
needs:

build/Targets.fs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,32 +77,40 @@ let private publishZip _ =
7777
let private publishContainers _ =
7878

7979
let createImage project =
80+
let ci = Environment.environVarOrNone "GITHUB_ACTIONS"
81+
let pr =
82+
match Environment.environVarOrNone "GITHUB_REF_NAME" with
83+
| None -> None
84+
| Some s when s.EndsWith "/merge" -> Some (s.Split('/') |> Seq.head)
85+
| _ -> None
8086
let imageTag =
8187
match project with
82-
| "docs-builder" -> "jammy-chiseled-aot"
83-
| _ -> "jammy-chiseled-aot"
88+
| _ -> "9.0-noble-chiseled-aot"
8489
let labels =
8590
let exitCode = exec {
8691
validExitCode (fun _ -> true)
8792
exit_code_of "git" "describe" "--tags" "--exact-match" "HEAD"
8893
}
89-
match exitCode with | 0 -> "edge;latest" | _ -> "edge"
94+
match (exitCode, pr) with
95+
| 0, _ -> "edge;latest"
96+
| _, None -> "edge"
97+
| _, Some pr -> $"ci-%s{pr}"
9098
let args =
9199
["publish"; $"src/tooling/%s{project}/%s{project}.csproj"]
92100
@ [
93101
"/t:PublishContainer";
94102
"-p"; "DebugType=none";
95-
"-p"; $"ContainerBaseImage=mcr.microsoft.com/dotnet/nightly/runtime-deps:8.0-%s{imageTag}";
103+
"-p"; $"ContainerBaseImage=mcr.microsoft.com/dotnet/nightly/runtime-deps:%s{imageTag}";
96104
"-p"; $"ContainerImageTags=\"%s{labels};%s{Software.Version.Normalize()}\""
97105
"-p"; $"ContainerRepository=elastic/%s{project}"
98106
]
99107
let registry =
100-
match Environment.environVarOrNone "GITHUB_ACTIONS" with
101-
| None -> []
102-
| Some _ -> [
103-
"-p"; "ContainerRegistry=ghcr.io"
104-
"-p"; "ContainerUser=1001:1001";
105-
]
108+
match (ci, pr) with
109+
| Some _, None -> [
110+
"-p"; "ContainerRegistry=ghcr.io"
111+
"-p"; "ContainerUser=1001:1001";
112+
]
113+
| _, _ -> []
106114
exec { run "dotnet" (args @ registry) }
107115
createImage "docs-builder"
108116
createImage "docs-assembler"

0 commit comments

Comments
 (0)