Skip to content

Bump unsafe-libyaml from 0.2.9 to 0.2.10 in /lambda-directly-optimized #48

Bump unsafe-libyaml from 0.2.9 to 0.2.10 in /lambda-directly-optimized

Bump unsafe-libyaml from 0.2.9 to 0.2.10 in /lambda-directly-optimized #48

name: "Build: bootstrap"
on:
push:
paths:
- "lambda-with-server/**"
- "lambda-directly/**"
- "lambda-directly-optimized/**"
- "lambda-cosmo/**"
- ".github/workflows/build-and-release.yml"
defaults:
run:
shell: bash # Set the default shell to bash.
jobs:
build-cosmo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v1
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
cache: true
- name: Install Zig toolchain
uses: korandoru/setup-zig@v1
with:
zig-version: 0.11.0
- name: Install Cargo Lambda
uses: jaxxstorm/[email protected]
with:
repo: cargo-lambda/cargo-lambda
platform: linux
arch: x86_64
- uses: mozilla-actions/[email protected]
name: 'Setup sccache'
- name: Build release build
run: just build lambda-cosmo
- uses: actions/upload-artifact@v3
with:
name: cosmo-arm
path: lambda-cosmo/target/lambda/router-cosmo/bootstrap
if-no-files-found: error
retention-days: 1
build-with-server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Build Apollo Router Lambda
uses: docker/build-push-action@v5
with:
context: lambda-with-server
load: true
tags: lambda
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Extract x86 bootstrap file
working-directory: lambda-with-server
run: |
export TMP_IMAGE_ID=$(docker create lambda)
docker cp $TMP_IMAGE_ID:/dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap bootstrap
docker rm -v $TMP_IMAGE_ID
- uses: actions/upload-artifact@v3
with:
name: with-server-x86-64
path: lambda-with-server/bootstrap
if-no-files-found: error
retention-days: 1
build-directly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Build Apollo Router Lambda
uses: docker/build-push-action@v5
with:
context: lambda-directly
load: true
tags: lambda
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Extract bootstrap file
working-directory: lambda-directly
run: |
export TMP_IMAGE_ID=$(docker create lambda)
docker cp $TMP_IMAGE_ID:/dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap bootstrap
docker rm -v $TMP_IMAGE_ID
- uses: actions/upload-artifact@v3
with:
name: directly-x86-64
path: lambda-directly/bootstrap
if-no-files-found: error
retention-days: 1
# build-directly-optimized-arm:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: docker/setup-qemu-action@v3
# - uses: docker/setup-buildx-action@v3
# - name: Build Apollo Router Lambda
# uses: docker/build-push-action@v5
# with:
# context: lambda-directly-optimized
# file: lambda-directly-optimized/Dockerfile-arm
# load: true
# tags: lambda
# platforms: linux/arm64
# cache-from: type=gha
# cache-to: type=gha,mode=max
# - name: Extract ARM bootstrap file
# working-directory: lambda-directly-optimized
# run: |
# mkdir -p arm
# export TMP_IMAGE_ID=$(docker create --platform linux/arm64 lambda)
# docker cp $TMP_IMAGE_ID:/dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap arm/bootstrap
# docker rm -v $TMP_IMAGE_ID
# - uses: actions/upload-artifact@v3
# with:
# name: directly-optimized-arm
# path: lambda-directly-optimized/arm/bootstrap
# if-no-files-found: error
# retention-days: 1
# build-directly-optimized-arm-graviton:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: docker/setup-qemu-action@v3
# - uses: docker/setup-buildx-action@v3
# - name: Build Apollo Router Lambda
# uses: docker/build-push-action@v5
# with:
# context: lambda-directly-optimized
# file: lambda-directly-optimized/Dockerfile-arm-graviton
# load: true
# tags: lambda
# platforms: linux/arm64
# cache-from: type=gha
# cache-to: type=gha,mode=max
# - name: Extract ARM bootstrap file
# working-directory: lambda-directly-optimized
# run: |
# mkdir -p arm
# export TMP_IMAGE_ID=$(docker create --platform linux/arm64 lambda)
# docker cp $TMP_IMAGE_ID:/dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap arm/bootstrap
# docker rm -v $TMP_IMAGE_ID
# - uses: actions/upload-artifact@v3
# with:
# name: directly-optimized-graviton-arm
# path: lambda-directly-optimized/arm/bootstrap
# if-no-files-found: error
# retention-days: 1
build-directly-optimized-arm-graviton-size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: depot/setup-action@v1
- name: Build Apollo Router Lambda
uses: depot/build-push-action@v1
with:
project: 790k10m5qn
token: ${{ secrets.DEPOT_TOKEN }}
context: lambda-directly-optimized
file: lambda-directly-optimized/Dockerfile-arm-graviton-size-al2023
load: true
tags: lambda
platforms: linux/arm64
- name: Extract ARM bootstrap file
working-directory: lambda-directly-optimized
run: |
mkdir -p arm
export TMP_IMAGE_ID=$(docker create --platform linux/arm64 lambda)
docker cp $TMP_IMAGE_ID:/dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap arm/bootstrap
docker rm -v $TMP_IMAGE_ID
- uses: actions/upload-artifact@v3
with:
name: directly-optimized-graviton-arm-size
path: lambda-directly-optimized/arm/bootstrap
if-no-files-found: error
retention-days: 1
build-directly-optimized-arm-graviton-speed:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: depot/setup-action@v1
- name: Build Apollo Router Lambda
uses: depot/build-push-action@v1
with:
project: 790k10m5qn
token: ${{ secrets.DEPOT_TOKEN }}
context: lambda-directly-optimized
file: lambda-directly-optimized/Dockerfile-arm-graviton-speed
load: true
tags: lambda
platforms: linux/arm64
- name: Extract ARM bootstrap file
working-directory: lambda-directly-optimized
run: |
mkdir -p arm
export TMP_IMAGE_ID=$(docker create --platform linux/arm64 lambda)
docker cp $TMP_IMAGE_ID:/dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap arm/bootstrap
docker rm -v $TMP_IMAGE_ID
- uses: actions/upload-artifact@v3
with:
name: directly-optimized-graviton-arm-speed
path: lambda-directly-optimized/arm/bootstrap
if-no-files-found: error
retention-days: 1
# build-directly-optimized-x86:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: docker/setup-buildx-action@v3
# - name: Build Apollo Router Lambda
# uses: docker/build-push-action@v5
# with:
# context: lambda-directly-optimized
# file: lambda-directly-optimized/Dockerfile-x86
# load: true
# tags: lambda
# cache-from: type=gha
# cache-to: type=gha,mode=max
# - name: Extract x86 bootstrap file
# working-directory: lambda-directly-optimized
# run: |
# mkdir -p x86
# export TMP_IMAGE_ID=$(docker create lambda)
# docker cp $TMP_IMAGE_ID:/dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap x86/bootstrap
# docker rm -v $TMP_IMAGE_ID
# - uses: actions/upload-artifact@v3
# with:
# name: directly-optimized-x86-64
# path: lambda-directly-optimized/x86/bootstrap
# if-no-files-found: error
# retention-days: 1
release:
runs-on: ubuntu-latest
needs:
[
build-with-server,
build-directly,
# build-directly-optimized-x86,
# build-directly-optimized-arm,
build-directly-optimized-arm-graviton-size,
build-directly-optimized-arm-graviton-speed,
build-cosmo,
]
steps:
- uses: actions/checkout@v4
- name: Setup artifact directory
run: mkdir -p ./release-artifacts
# Download all artifacts from previous jobs.
- uses: actions/download-artifact@v3
with:
path: ./release-artifacts/
- name: Rename release artifacts
run: |
mv release-artifacts/with-server-x86-64/bootstrap release-artifacts/bootstrap-with-server-x86-64
mv release-artifacts/directly-x86-64/bootstrap release-artifacts/bootstrap-directly-x86-64
# mv release-artifacts/directly-optimized-x86-64/bootstrap release-artifacts/bootstrap-directly-optimized-x86-64
# mv release-artifacts/directly-optimized-arm/bootstrap release-artifacts/bootstrap-directly-optimized-arm
mv release-artifacts/directly-optimized-graviton-arm-size/bootstrap release-artifacts/bootstrap-directly-optimized-graviton-arm-size
mv release-artifacts/directly-optimized-graviton-arm-speed/bootstrap release-artifacts/bootstrap-directly-optimized-graviton-arm-speed
mv release-artifacts/cosmo-arm/bootstrap release-artifacts/bootstrap-cosmo-arm
- name: Set release info
id: info
run: |
echo "git-sha=${GITHUB_SHA::10}" >> $GITHUB_OUTPUT
echo "tag-name=$(date +"%Y-%m-%d-at-%H-%M")" >> $GITHUB_OUTPUT
- uses: ncipollo/[email protected]
with:
# NOTE: release-artifacts/bootstrap-directly-optimized-arm is not included here.
# NOTE: release-artifacts/bootstrap-directly-optimized-x86-64 is not included here.
artifacts: "release-artifacts/bootstrap-with-server-x86-64,release-artifacts/bootstrap-directly-x86-64,release-artifacts/bootstrap-directly-optimized-graviton-arm-speed,release-artifacts/bootstrap-directly-optimized-graviton-arm-size,release-artifacts/bootstrap-cosmo-arm"
# Automatically create the tag from the commit if it doesn't exist.
tag: ${{ steps.info.outputs.tag-name }}
commit: ${{ github.sha }}
name: "Release ${{ steps.info.outputs.git-sha }}"
# Automatically generate the release notes, which can be configured. See more here
generateReleaseNotes: true
# Mark the deployment as the latest.
makeLatest: true