Skip to content
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

ci(publish): adapt pkg targets to x64 & arm64 #740

Merged
merged 1 commit into from
Jun 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions binaries/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,29 @@ npx prisma version
mkdir -p node_modules/prisma/node_modules/@prisma/engines
cp -R node_modules/@prisma/engines/* node_modules/prisma/node_modules/@prisma/engines

npx pkg -t node12-linux,node12-darwin,node12-win node_modules/prisma
npx pkg -t node16-linux-x64,node16-darwin-x64,node16-win-x64,node16-linux-arm64,node16-darwin-arm64,node16-win-arm64 node_modules/prisma

version=$(npx prisma version | grep '^\(prisma \)' | cut -d : -f 2 | cut -d " " -f 2)
mv prisma-macos "prisma-cli-$version-darwin"
mv prisma-linux "prisma-cli-$version-linux"
mv prisma-win.exe "prisma-cli-$version-windows.exe"

gzip "prisma-cli-$version-darwin"
gzip "prisma-cli-$version-linux"
gzip "prisma-cli-$version-windows.exe"

aws s3 cp "prisma-cli-$version-darwin.gz" "s3://$S3_BUCKET" --acl public-read
aws s3 cp "prisma-cli-$version-linux.gz" "s3://$S3_BUCKET" --acl public-read
aws s3 cp "prisma-cli-$version-windows.exe.gz" "s3://$S3_BUCKET" --acl public-read
mv prisma-macos-x64 "prisma-cli-$version-darwin-x64"
mv prisma-linux-x64 "prisma-cli-$version-linux-x64"
mv prisma-win-x64.exe "prisma-cli-$version-windows-x64.exe"
mv prisma-macos-arm64 "prisma-cli-$version-darwin-arm64"
mv prisma-linux-arm64 "prisma-cli-$version-linux-arm64"
mv prisma-win-arm64.exe "prisma-cli-$version-windows-arm64.exe"

gzip "prisma-cli-$version-darwin-x64"
gzip "prisma-cli-$version-linux-x64"
gzip "prisma-cli-$version-windows-x64.exe"
gzip "prisma-cli-$version-darwin-arm64"
gzip "prisma-cli-$version-linux-arm64"
gzip "prisma-cli-$version-windows-arm64.exe"

aws s3 cp "prisma-cli-$version-darwin-x64.gz" "s3://$S3_BUCKET" --acl public-read
aws s3 cp "prisma-cli-$version-linux-x64.gz" "s3://$S3_BUCKET" --acl public-read
aws s3 cp "prisma-cli-$version-windows-x64.exe.gz" "s3://$S3_BUCKET" --acl public-read
aws s3 cp "prisma-cli-$version-darwin-arm64.gz" "s3://$S3_BUCKET" --acl public-read
aws s3 cp "prisma-cli-$version-linux-arm64.gz" "s3://$S3_BUCKET" --acl public-read
aws s3 cp "prisma-cli-$version-windows-arm64.exe.gz" "s3://$S3_BUCKET" --acl public-read

cd ../..

Expand Down