Skip to content

Commit 3e2b75b

Browse files
committed
Fix preparing SDKs - don't use build-sdk-package job artifacts, build everything directly under RELEASEBUILD mode
1 parent 4315866 commit 3e2b75b

File tree

1 file changed

+19
-32
lines changed

1 file changed

+19
-32
lines changed

.github/workflows/ci.yaml

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -771,45 +771,32 @@ jobs:
771771
run : |
772772
prepareSDK() {
773773
distroSuffix="$1"
774-
artifactId="$2"
774+
sbtProject="$2"
775+
distDir="$3"
776+
777+
# Build binaries
778+
./project/scripts/sbt "${sbtProject}/Universal/stage"
779+
780+
outputPath="${distDir}/target/universal/stage"
775781
artifactName="scala3-${{ env.RELEASE_TAG }}${distroSuffix}"
782+
zipArchive="${artifactName}.zip"
783+
tarGzArchive="${artifactName}.tar.gz"
776784
777-
downloadedArchive="./artifact.zip"
778-
if [ -f "${downloadedArchive}" ]; then
779-
rm "${downloadedArchive}"
780-
fi
781-
782-
# Download previously prepared SDK bundle
783-
curl -L \
784-
-H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
785-
-H "Accept: application/vnd.github+json" \
786-
-o "${downloadedArchive}" \
787-
--retry 5 --retry-delay 10 --retry-connrefused \
788-
--max-time 600 --connect-timeout 60 \
789-
https://api.github.com/repos/scala/scala3/actions/artifacts/${artifactId}/zip
790-
791-
# Repackage content of .zip to .tar.gz and prepare digest
792-
tmpDir="./archive-tmp-dir"
793-
if [ -d "${tmpDir}" ]; then
794-
rm -r "${tmpDir}"
795-
fi
796-
mkdir "${tmpDir}"
797-
unzip "${downloadedArchive}" -d "${tmpDir}"
798-
799-
mv "${downloadedArchive}" "./${artifactName}.zip"
800-
tar -czf "${artifactName}.tar.gz" -C "${tmpDir}" .
785+
cwd=$(pwd)
786+
(cd $outputPath && zip -r ${zipArchive} . && mv ${zipArchive} "${cwd}/")
787+
tar -czf ${tarGzArchive} -C "$outputPath" .
801788
802789
# Caluclate SHA for each of archive files
803-
for file in "${artifactName}.zip" "${artifactName}.tar.gz"; do
790+
for file in "${zipArchive}" "${tarGzArchive}"; do
804791
sha256sum "${file}" > "${file}.sha256"
805792
done
806793
}
807-
prepareSDK "" ${{needs.build-sdk-package.outputs.universal-id}}
808-
prepareSDK "-aarch64-pc-linux" ${{needs.build-sdk-package.outputs.linux-aarch64-id}}
809-
prepareSDK "-x86_64-pc-linux" ${{needs.build-sdk-package.outputs.linux-x86_64-id}}
810-
prepareSDK "-aarch64-apple-darwin" ${{needs.build-sdk-package.outputs.mac-aarch64-id}}
811-
prepareSDK "-x86_64-apple-darwin" ${{needs.build-sdk-package.outputs.mac-x86_64-id}}
812-
prepareSDK "-x86_64-pc-win32" ${{needs.build-sdk-package.outputs.win-x86_64-id}}
794+
prepareSDK "" "dist" "./dist/"
795+
prepareSDK "-aarch64-pc-linux" "dist-linux-aarch64" "./dist/linux-aarch64/"
796+
prepareSDK "-x86_64-pc-linux" "dist-linux-x86_64" "./dist/linux-x86_64/"
797+
prepareSDK "-aarch64-apple-darwin" "dist-mac-aarch64" "./dist/mac-aarch64/"
798+
prepareSDK "-x86_64-apple-darwin" "dist-mac-x86_64" "./dist/mac-x86_64/"
799+
prepareSDK "-x86_64-pc-win32" "dist-win-x86_64" "./dist/win-x86_64/"
813800
814801
# Create the GitHub release
815802
- name: Create GitHub Release

0 commit comments

Comments
 (0)