-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(NODE-6186): add downloading to FLE build script (#5)
Co-authored-by: Durran Jordan <[email protected]>
- Loading branch information
Showing
5 changed files
with
236 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ARG NODE_BUILD_IMAGE=node:16.20.1-bullseye | ||
FROM $NODE_BUILD_IMAGE AS build | ||
|
||
WORKDIR /mongodb-client-encryption | ||
COPY . . | ||
|
||
RUN node /mongodb-client-encryption/.github/scripts/libmongocrypt.mjs | ||
|
||
FROM scratch | ||
|
||
COPY --from=build /mongodb-client-encryption/prebuilds/ / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,81 @@ | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: {} | ||
|
||
name: build | ||
|
||
jobs: | ||
build: | ||
host_builds: | ||
strategy: | ||
matrix: | ||
os: [macos-11, macos-latest, windows-2019] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build ${{ matrix.os }} Prebuild | ||
run: node .github/scripts/libmongocrypt.mjs ${{ runner.os == 'Windows' && '--build' || '' }} | ||
shell: bash | ||
|
||
- id: upload | ||
name: Upload prebuild | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-${{ matrix.os }} | ||
path: prebuilds/ | ||
if-no-files-found: 'error' | ||
retention-days: 1 | ||
compression-level: 0 | ||
|
||
container_builds: | ||
outputs: | ||
artifact_id: ${{ steps.upload.outputs.artifact-id }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: ['20.x'] # '16.x', '18.x', | ||
name: Node.js ${{ matrix.node }} build | ||
matrix: | ||
linux_arch: [s390x, arm64, amd64] | ||
steps: | ||
- uses: actions/setup-node@v4 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Run Buildx | ||
run: | | ||
docker buildx create --name builder --bootstrap --use | ||
docker buildx build --platform linux/${{ matrix.linux_arch }} --output type=local,dest=./prebuilds,platform-split=false -f ./.github/docker/Dockerfile.glibc . | ||
- id: upload | ||
name: Upload prebuild | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'npm' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm install -g npm@latest | ||
shell: bash | ||
- run: node .github/scripts/libmongocrypt.mjs | ||
shell: bash | ||
name: build-linux-${{ matrix.linux_arch }} | ||
path: prebuilds/ | ||
if-no-files-found: 'error' | ||
retention-days: 1 | ||
compression-level: 0 | ||
|
||
collect: | ||
needs: [host_builds, container_builds] | ||
runs-on: ubunutu-latest | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
|
||
- name: Display structure of downloaded files | ||
run: ls -R | ||
|
||
- id: upload | ||
name: Upload all prebuilds | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: all-build | ||
path: '*.tar.gz' | ||
if-no-files-found: 'error' | ||
retention-days: 1 | ||
compression-level: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,4 @@ xunit.xml | |
lib | ||
prebuilds | ||
|
||
_libmongocrypt/ | ||
_libmongocrypt* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters