diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index cb71a42f..00000000 --- a/.dockerignore +++ /dev/null @@ -1,26 +0,0 @@ -**/.DS_Store -**/.dockerignore -**/.env -**/.git -**/.gitignore -**/.project -**/.settings -**/.toolstarget -**/.vs -**/.vscode -**/*.*proj.user -**/*.dbmdl -**/artifacts -**/bin -**/charts -**/docker-compose* -**/compose* -**/Dockerfile* -**/obj -**/secrets.dev.yaml -**/values.dev.yaml -LICENSE -README.md -!.git/HEAD -!.git/config -!.git/refs/heads/ diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 35488cd4..7f2f1b2f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,5 @@ version: 2 updates: -- package-ecosystem: docker - directory: "/" - schedule: - interval: daily - time: "05:30" - timezone: Europe/London - reviewers: - - "martincostello" - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2cc6104f..db675b83 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,6 +52,21 @@ jobs: steps: + - name: Setup arm64 support for native AoT + if: runner.os == 'Linux' + shell: bash + run: | + sudo dpkg --add-architecture arm64 + sudo bash -c 'cat > /etc/apt/sources.list.d/arm64.list <> "$GITHUB_ENV" @@ -143,6 +155,7 @@ jobs: aws-region: ${{ env.AWS_REGION }} - name: Update function code + shell: bash run: | aws lambda update-function-code \ --function-name "${FUNCTION_NAME}" \ @@ -151,12 +164,14 @@ jobs: > /dev/null - name: Wait for function code update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \ > /dev/null - name: Update function configuration + shell: bash run: | aws lambda update-function-configuration \ --function-name "${FUNCTION_NAME}" \ @@ -169,6 +184,7 @@ jobs: > /dev/null - name: Wait for function configuration update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \ @@ -219,6 +235,7 @@ jobs: steps: - name: Set function name + shell: bash run: | echo "FUNCTION_NAME=${LAMBDA_FUNCTION}" >> "$GITHUB_ENV" @@ -247,6 +264,7 @@ jobs: aws-region: ${{ env.AWS_REGION }} - name: Update function code + shell: bash run: | aws lambda update-function-code \ --function-name "${FUNCTION_NAME}" \ @@ -255,12 +273,14 @@ jobs: > /dev/null - name: Wait for function code update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \ > /dev/null - name: Update function configuration + shell: bash run: | aws lambda update-function-configuration \ --function-name "${FUNCTION_NAME}" \ @@ -273,6 +293,7 @@ jobs: > /dev/null - name: Wait for function configuration update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \ diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4011a827..47b21e08 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -162,6 +162,7 @@ jobs: env: ARTIFACT_PATH: ${{ steps.download-artifact.outputs.zip-path }} STAGING_PATH: '${{ github.workspace }}/staging' + shell: bash run: | mkdir --parents "${STAGING_PATH}" unzip -q "${ARTIFACT_PATH}" -d "${STAGING_PATH}" @@ -181,6 +182,7 @@ jobs: LAMBDA_ARTIFACT_REF: ${{ steps.download-artifact.outputs.ref }} LAMBDA_ARTIFACT_RUN_NUMBER: ${{ steps.download-artifact.outputs.run-number }} LAMBDA_ENVIRONMENT: ${{ steps.get-environment-name.outputs.result }} + shell: bash run: | environment_name="${LAMBDA_ENVIRONMENT}" lambda_config="$(unzip -p "${LAMBDA_ARTIFACT_PATH}/${LAMBDA_FUNCTION}.zip" aws-lambda-tools-defaults.json)" @@ -279,6 +281,7 @@ jobs: aws-region: ${{ env.AWS_REGION }} - name: Update function code + shell: bash run: | aws lambda update-function-code \ --function-name "${FUNCTION_NAME}" \ @@ -287,12 +290,14 @@ jobs: > /dev/null - name: Wait for function code update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \ > /dev/null - name: Update function configuration + shell: bash run: | aws lambda update-function-configuration \ --function-name "${FUNCTION_NAME}" \ @@ -305,6 +310,7 @@ jobs: > /dev/null - name: Wait for function configuration update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \ diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 9051fcf5..00000000 --- a/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0@sha256:bb65e39b662be0265f780afae9cdbfcaa315ef63edb245ad9fb2aa1aabca0b6b AS build -ARG TARGETARCH - -RUN dpkg --add-architecture arm64 -RUN apt update && apt install --yes clang gcc-aarch64-linux-gnu llvm zlib1g-dev zlib1g-dev:arm64 - -WORKDIR /source - -COPY . . - -RUN DOTNET_INSTALL_DIR="/usr/share/dotnet" && curl -sSL https://raw.githubusercontent.com/dotnet/install-scripts/5b142a1e445a6f060d6430b661408989e9580b85/src/dotnet-install.sh | bash /dev/stdin --jsonfile global.json --install-dir $DOTNET_INSTALL_DIR - -RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \ - dotnet publish ./src/LondonTravel.Skill --runtime linux-arm64 --self-contained true /p:AssemblyName=bootstrap /p:PublishAot=true /p:PublishReadyToRun=true - -FROM scratch AS export -ARG TARGETARCH -COPY --from=build /source/artifacts/publish/LondonTravel.Skill/release_*/ ./artifacts/publish/LondonTravel.Skill/release_linux-arm64 diff --git a/build.ps1 b/build.ps1 index 98b42978..ce1782b6 100755 --- a/build.ps1 +++ b/build.ps1 @@ -91,7 +91,7 @@ function DotNetPublish { if ($IsLinux -And (-Not $UseManagedRuntime)) { $additionalArgs += "--runtime" - $additionalArgs += "linux-x64" + $additionalArgs += "linux-arm64" $additionalArgs += "--self-contained" $additionalArgs += "true" $additionalArgs += "/p:AssemblyName=bootstrap"