-
Notifications
You must be signed in to change notification settings - Fork 3
chore(NODE-6186): add downloading to FLE build script #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4c934ab
chore: prefer downloading libmongocrypt to building
nbbeeken 6ebf689
fix: lib64 on some platforms
nbbeeken bc62e11
fix: import
nbbeeken 8ef162d
chore: build on PR
nbbeeken a787dbe
chore: yml
nbbeeken d190196
chore: get code 🤦
nbbeeken a4ebe59
chore: make script work from any directory, organize steps into main …
nbbeeken edc5f26
chore: errexit
nbbeeken 09ccdd3
chore(NODE-6176): add prebuilds in CI (#7)
nbbeeken 1d76537
chore: try catch rename in script
durran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.