Skip to content

Commit c9f39a5

Browse files
authored
[Backport 7.12] Fix make assemble to produce zip #5409 (#5411)
(cherry picked from commit f6cee9c) (cherry picked from commit 67a1a5f)
1 parent 7f822a5 commit c9f39a5

File tree

4 files changed

+54
-2
lines changed

4 files changed

+54
-2
lines changed

.ci/make.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ repo=$(realpath "$script_path/../")
1111
# shellcheck disable=SC1090
1212
CMD=$1
1313
TASK=$1
14+
TASK_ARGS=()
1415
VERSION=$2
1516
STACK_VERSION=$VERSION
1617
set -euo pipefail
@@ -32,8 +33,14 @@ docker build --file .ci/DockerFile --tag elastic/elasticsearch-net .
3233
echo -e "\033[1m>>>>> Run [elastic/elasticsearch-net container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
3334

3435
case $CMD in
36+
clean)
37+
echo -e "\033[36;1mRemoving $output_folder\033[0m"
38+
TASK=clean
39+
rm -rf "$output_folder"
40+
;;
3541
assemble)
3642
TASK=release
43+
TASK_ARGS=("$VERSION" "$output_folder" "skiptests")
3744
;;
3845
*)
3946
echo -e "\nUsage:\n\t $CMD is not supported right now\n"
@@ -47,4 +54,4 @@ docker run \
4754
--volume "${OUTPUT_DIR}:/sln/${output_folder}" \
4855
--rm \
4956
elastic/elasticsearch-net \
50-
./build.sh release "$VERSION" "$output_folder" "skiptests"
57+
./build.sh $TASK "${TASK_ARGS[@]}"

.github/workflows/unified-release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Unified Release
2+
3+
4+
on:
5+
pull_request:
6+
paths-ignore:
7+
- 'README.md'
8+
- '.editorconfig'
9+
push:
10+
paths-ignore:
11+
- 'README.md'
12+
- '.editorconfig'
13+
branches:
14+
- main
15+
- master
16+
- '[0-9]+.[0-9]+'
17+
- '[0-9]+.x'
18+
19+
jobs:
20+
assemble:
21+
name: Assemble
22+
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
stack_version: [ '8.0.0-SNAPSHOT']
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v2
31+
- uses: actions/setup-dotnet@v1
32+
with:
33+
dotnet-version: '5.0.100'
34+
35+
- run: "./.ci/make.sh assemble ${{ matrix.stack_version }}"
36+
name: Assemble ${{ matrix.stack_version }}
37+

build/scripts/Targets.fs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ open System.IO
1010
open Bullseye
1111
open ProcNet
1212
open Fake.Core
13+
open Fake.IO.Globbing.Operators
1314

1415
module Main =
1516

@@ -60,7 +61,7 @@ module Main =
6061
let canaryChain = [ "version"; "release"; "test-nuget-package";]
6162

6263
// the following are expected to be called as targets directly
63-
conditional "clean" parsed.ReleaseBuild <| fun _ -> Build.Clean parsed
64+
conditional "clean" (parsed.ReleaseBuild || parsed.Target = "clean") <| fun _ -> Build.Clean parsed
6465
target "version" <| fun _ -> printfn "Artifacts Version: %O" artifactsVersion
6566

6667
target "restore" Build.Restore
@@ -92,6 +93,10 @@ module Main =
9293
printfn "Finished Release Build %O, artifacts available at: %s" artifactsVersion Paths.BuildOutput
9394
| Some path ->
9495
Fake.IO.Shell.cp_r Paths.BuildOutput path
96+
let zipName = sprintf "elasticsearch-net-%O.zip" artifactsVersion.Full
97+
let outputZip = Path.Combine(path, zipName)
98+
let files = !! (sprintf "%s/*.*" path) -- outputZip
99+
Fake.IO.Zip.createZip "." outputZip "elastic/elasticsearch-net artifact" 9 true files
95100
printfn "Finished Release Build %O, output copied to: %s" artifactsVersion path
96101

97102
conditional "test-nuget-package" (not parsed.SkipTests) <| fun _ -> Tests.RunReleaseUnitTests artifactsVersion parsed

build/scripts/scripts.fsproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
<Content Include="..\..\.github\workflows\test-jobs.yml"><Link>test-jobs.yml</Link></Content>
2929
<Content Include="..\..\.github\workflows\stale-jobs.yml"><Link>stale-jobs.yml</Link></Content>
3030
<Content Include="..\..\.github\workflows\integration-jobs.yml"><Link>integration-jobs.yml</Link></Content>
31+
<Content Include="..\..\.github\workflows\unified-release.yml">
32+
<Link>unified-release.yml</Link>
33+
</Content>
3134
</ItemGroup>
3235
<ItemGroup>
3336
<PackageReference Include="FSharp.Core" Version="5.0.0" />

0 commit comments

Comments
 (0)