-
Notifications
You must be signed in to change notification settings - Fork 291
ci: Migrate to GH Actions for release #4947
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
57 commits
Select commit
Hold shift + click to select a range
fce7f60
ci(github): Build Linux engines (#1)
janpio 67eeb41
add run-name
janpio 85b6eb0
fix: add target_path to Linux Status (x86_64) (#3)
janpio fcd359c
chore: update actions and autoformat
Jolg42 1066fe8
ci: do all the things `engineer` CLI does for releasing engines (#4)
Jolg42 11d5222
remove /target from cache
Jolg42 dc3a9f9
add release if github.event_name == 'workflow_dispatch'
Jolg42 55e4249
Comment out push/pr triggers
SevInf 7f939ec
Run on PR (tmp)
SevInf a8eb599
Remove old pipelines, make commit optional
SevInf 7afe03d
Run linux jobs in docker containers
SevInf 5d40047
Revert "Run linux jobs in docker containers"
SevInf f718f4f
Remove explicit repository
SevInf 5d38d3d
Try to mount cache dirs, use rust-toolchain files
SevInf 12ded1a
No quotes
SevInf cd269da
Add osx arm toolchain
SevInf b5c922b
Uncomment s3 upload
SevInf 419654b
Fix shellcheck
SevInf 1f92a7b
Correct bucket
SevInf b742d2c
Comment out R2
SevInf d327069
Setup R2 uploads again
SevInf b046d88
Add workflow-dispatch for engines-wrapper
SevInf 997cc36
Fix script
SevInf 0a9f4d4
Use github.sha everywhere
SevInf edb7ecd
Use prisma bot token
SevInf f1e9591
Use repository dispatch
SevInf a3aade1
Use short branch name
SevInf 7db82d8
Correct repo for dispatch
SevInf c499eac
head-ref?
SevInf a24f166
Skip engines build if no release is necessary
SevInf 9f7f1a1
Add all DBs tested on buildkite to GH Actions
SevInf 9b16698
Split qe test job into multiple jobs because FML
SevInf f97a079
Adjust job/workflows names
SevInf aa77410
And again
SevInf c2374c6
Run mysql as single threaded
SevInf 95ee047
Ignore joins test on old mysql
SevInf bff9042
Bring back mariadb
SevInf bcf6606
Organize pipelines better
SevInf 8c7a9b1
Add order by to fix postgres9
SevInf f05b678
Move DA tests into unified view
SevInf a4e46f1
Cleanup
SevInf 56b2ac4
Address some of the review comments
SevInf a887937
Pull command construction into separate script
SevInf abe3d4f
Correctly check for [integration]
SevInf 91a2846
PR-safe way of getting commit message
SevInf e8037c8
n1
SevInf 823f3f0
Correct multiline string
SevInf c6aee02
Checkout different ref
SevInf 3632ef2
Try more things
SevInf c6ad057
Fix shellcheck
SevInf 9a85652
Check repository owner
SevInf 8a80814
I am sad
SevInf ec4c72e
permissions?
SevInf 3e7fff4
Revert to prisma bot token
SevInf 83783e1
Revert back to membership check
SevInf 9d5af26
Please
SevInf 1249e88
Uncomment triggers
SevInf 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
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 |
|---|---|---|
| @@ -0,0 +1,202 @@ | ||
| name: Build Engines for Linux | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| commit: | ||
| description: 'Commit on the given branch to build' | ||
| type: string | ||
| required: false | ||
|
|
||
| jobs: | ||
| build: | ||
| name: '${{ matrix.target.name }} for commit ${{ inputs.commit }}' | ||
| runs-on: ubuntu-22.04 | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # ⚠️ The target names are used to dtermine the directory name when uploaded to the buckets. | ||
| # Do not change them. | ||
| target: | ||
| # Linux Glibc | ||
| - name: 'rhel-openssl-1.0.x' | ||
| image: 'prismagraphql/build:rhel-libssl1.0.x' | ||
| target_string: '' | ||
| target_path: '' | ||
| features_string: '--features vendored-openssl' | ||
| - name: 'rhel-openssl-1.1.x' | ||
| image: 'prismagraphql/build:rhel-libssl1.1.x' | ||
| target_string: '' | ||
| target_path: '' | ||
| features_string: '' | ||
| - name: 'rhel-openssl-3.0.x' | ||
| image: 'prismagraphql/build:rhel-libssl3.0.x' | ||
| target_string: '' | ||
| target_path: '' | ||
| features_string: '' | ||
| # Linux Musl | ||
| # A better name would be "linux-musl-openssl-1.1.x" | ||
| # But we keep the old name for compatibility reasons | ||
| - name: 'linux-musl' | ||
| image: 'prismagraphql/build:alpine-libssl1.1.x' | ||
| target_string: '' | ||
| target_path: '' | ||
| features_string: '' | ||
| - name: 'linux-musl-openssl-3.0.x' | ||
| image: 'prismagraphql/build:alpine-libssl3.0.x' | ||
| target_string: '' | ||
| target_path: '' | ||
| features_string: '' | ||
| # Linux Static x86_64 | ||
| # Note that the name should have "-static-" | ||
| # Because we look for "-static-" later in the construct_build_command step | ||
| - name: 'linux-static-x64' | ||
| image: 'prismagraphql/build:linux-static-x64' | ||
| target_string: '--target x86_64-unknown-linux-musl' | ||
| target_path: 'x86_64-unknown-linux-musl' | ||
| features_string: '--features vendored-openssl' | ||
| # Linux Glibc ARM64 | ||
| - name: 'linux-arm64-openssl-1.0.x' | ||
| image: 'prismagraphql/build:cross-linux-arm-ssl-1.0.x' | ||
| target_string: '--target aarch64-unknown-linux-gnu' | ||
| target_path: 'aarch64-unknown-linux-gnu' | ||
| features_string: '--features vendored-openssl' | ||
| - name: 'linux-arm64-openssl-1.1.x' | ||
| image: 'prismagraphql/build:cross-linux-arm-ssl-1.1.x' | ||
| target_string: '--target aarch64-unknown-linux-gnu' | ||
| target_path: 'aarch64-unknown-linux-gnu' | ||
| features_string: '' | ||
| - name: 'linux-arm64-openssl-3.0.x' | ||
| image: 'prismagraphql/build:cross-linux-arm-ssl-3.0.x' | ||
| target_string: '--target aarch64-unknown-linux-gnu' | ||
| target_path: 'aarch64-unknown-linux-gnu' | ||
| features_string: '' | ||
| # Linux Musl ARM64 | ||
| - name: 'linux-musl-arm64-openssl-1.1.x' | ||
| image: 'prismagraphql/build:cross-linux-musl-arm-ssl-1.1.x' | ||
| target_string: '--target aarch64-unknown-linux-musl' | ||
| target_path: 'aarch64-unknown-linux-musl' | ||
| features_string: '' | ||
| - name: 'linux-musl-arm64-openssl-3.0.x' | ||
| image: 'prismagraphql/build:cross-linux-musl-arm-ssl-3.0.x' | ||
| target_string: '--target aarch64-unknown-linux-musl' | ||
| target_path: 'aarch64-unknown-linux-musl' | ||
| features_string: '' | ||
| # Linux Static ARM64 | ||
| # Note that the name should have "-static-" | ||
| # Because we look for "-static-" later in the construct_build_command step | ||
| - name: 'linux-static-arm64' | ||
| image: 'prismagraphql/build:linux-static-arm64' | ||
| target_string: '--target aarch64-unknown-linux-musl' | ||
| target_path: 'aarch64-unknown-linux-musl' | ||
| features_string: '--features vendored-openssl' | ||
|
|
||
| steps: | ||
| - name: Output link to commit | ||
| if: ${{ inputs.commit }} | ||
| run: echo https://github.com/prisma/prisma-engines/commit/${{ inputs.commit }} | ||
|
|
||
| - name: Checkout ${{ inputs.commit }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ inputs.commit }} | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cargo/bin/ | ||
| ~/.cargo/registry/index/ | ||
| ~/.cargo/registry/cache/ | ||
| ~/.cargo/git/db/ | ||
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
| restore-keys: ${{ runner.os }}-cargo- | ||
|
|
||
| - name: Construct build command | ||
| id: construct_build_command | ||
| env: | ||
| TARGET_NAME: ${{ matrix.target.name }} | ||
| IMAGE: ${{ matrix.target.image }} | ||
| TARGET_STRING: ${{ matrix.target.target_string }} | ||
| FEATURES_STRING: ${{ matrix.target.features_string }} | ||
| run: | | ||
| set -eux; | ||
|
|
||
| command=$(bash .github/workflows/utils/constructDockerBuildCommand.sh) | ||
|
|
||
| # store command in GitHub output | ||
| echo "COMMAND=$command" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Show Build Command | ||
| env: | ||
| COMMAND: ${{ steps.construct_build_command.outputs.COMMAND }}" | ||
| run: echo "Build command is $COMMAND" | ||
|
|
||
| - name: Execute Build command | ||
| run: ${{ steps.construct_build_command.outputs.command }} | ||
|
|
||
| - name: Prepare files for "release" target | ||
| if: ${{ matrix.target.target_path == '' }} | ||
| env: | ||
| TARGET_NAME: ${{ matrix.target.name }} | ||
| RELEASE_DIR: ${{ github.workspace }}/target/release | ||
| run: | | ||
| echo "Files in target/release before renaming" | ||
| ls -la $RELEASE_DIR | ||
|
|
||
| echo "Copying files to engines-artifacts" | ||
| cp -r $RELEASE_DIR/ engines-artifacts | ||
|
|
||
| echo "Rename libquery_engine.so to libquery_engine.so.node for non-static targets" | ||
| if [[ "$TARGET_NAME" == *-static-* ]]; then | ||
| echo "Current target is static. Skipping." | ||
| else | ||
| mv engines-artifacts/libquery_engine.so engines-artifacts/libquery_engine.so.node | ||
| fi | ||
|
|
||
| echo "Files in engines-artifacts after renaming" | ||
| ls -la engines-artifacts | ||
|
|
||
| - name: Upload artifacts for "release" target | ||
| uses: actions/upload-artifact@v4 | ||
| if: ${{ matrix.target.target_path == '' }} | ||
| with: | ||
| name: '${{ matrix.target.name }}' | ||
| path: | | ||
| ${{ github.workspace }}/engines-artifacts/libquery_engine.so.node | ||
| ${{ github.workspace }}/engines-artifacts/schema-engine | ||
| ${{ github.workspace }}/engines-artifacts/query-engine | ||
| ${{ github.workspace }}/engines-artifacts/prisma-fmt | ||
|
|
||
| - name: Prepare files for "${{ matrix.target.name }}" target | ||
| if: ${{ matrix.target.target_path != '' }} | ||
| env: | ||
| TARGET_NAME: ${{ matrix.target.name }} | ||
| RELEASE_DIR: ${{ github.workspace }}/target/${{ matrix.target.target_path }}/release | ||
| run: | | ||
| echo "Files in target/release before renaming" | ||
| ls -la $RELEASE_DIR | ||
|
|
||
| echo "Copying files to engines-artifacts" | ||
| cp -r $RELEASE_DIR/ engines-artifacts | ||
|
|
||
| echo "Rename libquery_engine.so to libquery_engine.so.node for non-static targets" | ||
| if [[ "$TARGET_NAME" == *-static-* ]]; then | ||
| echo "Current target is static. Skipping." | ||
| else | ||
| mv engines-artifacts/libquery_engine.so engines-artifacts/libquery_engine.so.node | ||
| fi | ||
|
|
||
| echo "Files in engines-artifacts after renaming" | ||
| ls -la engines-artifacts | ||
|
|
||
| - name: Upload artifacts for "${{ matrix.target.name }}" target | ||
| uses: actions/upload-artifact@v4 | ||
| if: ${{ matrix.target.target_path != '' }} | ||
| with: | ||
| name: ${{ matrix.target.name }} | ||
| path: | | ||
| ${{ github.workspace }}/engines-artifacts/libquery_engine.so.node | ||
| ${{ github.workspace }}/engines-artifacts/schema-engine | ||
| ${{ github.workspace }}/engines-artifacts/query-engine | ||
| ${{ github.workspace }}/engines-artifacts/prisma-fmt | ||
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.