Skip to content

Commit ed6aa8a

Browse files
authored
Add Lambda build and release jobs to CI workflows (#840)
* Add Lambda build and release jobs to CI workflows This commit introduces a new `build-lambda` job in the PR workflow and a `release-lambda` job in the release workflow. These jobs handle building the Amazon Linux 2023 container, extracting the bootstrap binary, and preparing artifacts for distribution. A placeholder step to publish to AWS is included in the release workflow. * checkout before docker build * Update Dockerfile to correct publish path Fixed the path in the `dotnet publish` command to ensure the correct directory is targeted. This resolves potential build issues caused by the incorrect source path. * move away from fish syntax to bash * update release flow as well * call stat on expected output bootstrap file * tree .artifacts * update output paths
1 parent 2d12246 commit ed6aa8a

File tree

10 files changed

+38
-113
lines changed

10 files changed

+38
-113
lines changed

.github/workflows/pr.yml

+13
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ env:
1414
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
1515

1616
jobs:
17+
build-lambda:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Amazon Linux 2023 build
22+
run: |
23+
docker build . -t publish-links-index:latest -f src/infra/docs-lambda-index-publisher/lambda.DockerFile
24+
- name: Get bootstrap binary
25+
run: |
26+
docker cp $(docker create --name tc publish-links-index:latest):/app/.artifacts/publish ./.artifacts && docker rm tc
27+
tree .artifacts
28+
stat .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
29+
1730
build:
1831
runs-on: ${{ matrix.os }}
1932
strategy:

.github/workflows/release.yml

+17
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@ jobs:
3333
- name: Publish Containers
3434
run: ./build.sh publishcontainers
3535

36+
release-lambda:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Amazon Linux 2023 build
40+
run: |
41+
docker build . -t publish-links-index:latest -f src/infra/docs-lambda-index-publisher/lambda.DockerFile
42+
- name: Get bootstrap binary
43+
run: |
44+
docker cp $(docker create --name tc publish-links-index:latest):/app/.artifacts/publish ./.artifacts && docker rm tc
45+
46+
# TODO publish to AWS
47+
- name: Attach Distribution to release
48+
env:
49+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
run: gh release upload ${{ github.ref_name }} .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
51+
shell: bash
52+
3653
release:
3754
needs: [containers]
3855
strategy:

docs-builder.sln

+5-2
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "update-reference-index", "u
7171
actions\update-reference-index\action.yml = actions\update-reference-index\action.yml
7272
EndProjectSection
7373
EndProject
74-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "docs-lambda-index-publisher", "src\docs-lambda-index-publisher\docs-lambda-index-publisher.csproj", "{C559D52D-100B-4B2B-BE87-2344D835761D}"
74+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "docs-lambda-index-publisher", "src\infra\docs-lambda-index-publisher\docs-lambda-index-publisher.csproj", "{C559D52D-100B-4B2B-BE87-2344D835761D}"
7575
EndProject
7676
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "docs-assembler.Tests", "tests\docs-assembler.Tests\src\docs-assembler.Tests\docs-assembler.Tests.csproj", "{CDC0ECF4-6597-4FBA-8D25-5C244F0877E3}"
7777
EndProject
78+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "infra", "infra", "{4894063D-0DEF-4B7E-97D0-0D0A5B85C608}"
79+
EndProject
7880
Global
7981
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8082
Debug|Any CPU = Debug|Any CPU
@@ -143,7 +145,8 @@ Global
143145
{6E2ED6CC-AFC1-4E58-965D-6AEC500EBB46} = {245023D2-D3CA-47B9-831D-DAB91A2FFDC7}
144146
{6554F917-73CE-4B3D-9101-F28EAA762C6B} = {245023D2-D3CA-47B9-831D-DAB91A2FFDC7}
145147
{9FEC15F6-13F8-40B1-A66A-EB054E49E680} = {245023D2-D3CA-47B9-831D-DAB91A2FFDC7}
146-
{C559D52D-100B-4B2B-BE87-2344D835761D} = {BE6011CC-1200-4957-B01F-FCCA10C5CF5A}
147148
{CDC0ECF4-6597-4FBA-8D25-5C244F0877E3} = {67B576EE-02FA-4F9B-94BC-3630BC09ECE5}
149+
{4894063D-0DEF-4B7E-97D0-0D0A5B85C608} = {BE6011CC-1200-4957-B01F-FCCA10C5CF5A}
150+
{C559D52D-100B-4B2B-BE87-2344D835761D} = {4894063D-0DEF-4B7E-97D0-0D0A5B85C608}
148151
EndGlobalSection
149152
EndGlobal

src/docs-assembler/Cli/LinkRegistryCommands.cs

-107
This file was deleted.

src/docs-assembler/Program.cs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
app.UseFilter<StopwatchFilter>();
2222
app.UseFilter<CatchExceptionFilter>();
2323

24-
app.Add<LinkRegistryCommands>("link-registry");
2524
app.Add<InboundLinkCommands>("inbound-links");
2625
app.Add<RepositoryCommands>("repo");
2726

src/docs-lambda-index-publisher/README.md src/infra/docs-lambda-index-publisher/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ From a linux `x86_64` machine you can use the followint to build a AOT binary th
55
on a vanilla `Amazon Linux 2023` without any dependencies.
66

77
```bash
8-
docker build . -t publish-links-index:latest -f src/docs-lambda-index-publisher/lambda.DockerFile
8+
docker build . -t publish-links-index:latest -f src/infra/docs-lambda-index-publisher/lambda.DockerFile
99
```
1010

1111
Then you can copy the published artifacts from the image using:

src/docs-lambda-index-publisher/docs-lambda-index-publisher.csproj src/infra/docs-lambda-index-publisher/docs-lambda-index-publisher.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<PackageReference Include="AWSSDK.S3" Version="3.7.414.5"/>
2626
</ItemGroup>
2727
<ItemGroup>
28-
<ProjectReference Include="..\Elastic.Markdown\Elastic.Markdown.csproj"/>
28+
<ProjectReference Include="..\..\Elastic.Markdown\Elastic.Markdown.csproj"/>
2929
</ItemGroup>
3030
</Project>
3131

src/docs-lambda-index-publisher/lambda.DockerFile src/infra/docs-lambda-index-publisher/lambda.DockerFile

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ RUN arch=$TARGETARCH \
3131
&& if [ "$arch" = "amd64" ]; then arch="x64"; fi \
3232
&& echo $TARGETOS-$arch > /tmp/rid
3333

34-
RUN dotnet publish src/docs-lambda-index-publisher -r linux-x64 -c Release
34+
RUN dotnet publish src/infra/docs-lambda-index-publisher -r linux-x64 -c Release
3535

0 commit comments

Comments
 (0)