@@ -663,6 +663,13 @@ jobs:
663
663
echo "This build version: $ver"
664
664
echo "THISBUILD_VERSION=$ver" >> $GITHUB_ENV
665
665
666
+ - name : Check is version matching pattern
667
+ run : |
668
+ if ! grep -Eo "3\.[0-9]+\.[0-9]+-RC[0-9]+-bin-[0-9]{8}-[a-zA-Z0-9]{7}-NIGHTLY" <<< "${{ env.THISBUILD_VERSION }}"; then
669
+ echo "Version used by compiler to publish nightly release does not match expected pattern"
670
+ exit 1
671
+ fi
672
+
666
673
- name : Check whether not yet published
667
674
id : not_yet_published
668
675
continue-on-error : true
@@ -766,49 +773,47 @@ jobs:
766
773
- name : Extract the release tag
767
774
run : echo "RELEASE_TAG=${GITHUB_REF#*refs/tags/}" >> $GITHUB_ENV
768
775
776
+ - name : Check compiler version
777
+ shell : bash
778
+ run : |
779
+ version=$(./project/scripts/sbt "print scala3-compiler-bootstrapped/version" | tail -n1)
780
+ echo "This build version: ${version}"
781
+ if [ "${version}" != "${{ env.RELEASE_TAG }}" ]; then
782
+ echo "Compiler version for this build '${version}', does not match tag: ${{ env.RELEASE_TAG }}"
783
+ exit 1
784
+ fi
785
+
769
786
- name : Prepare the SDKs
787
+ shell : bash
770
788
run : |
771
- function prepareSDK() {
789
+ prepareSDK() {
772
790
distroSuffix="$1"
773
- artifactId="$2"
791
+ sbtProject="$2"
792
+ distDir="$3"
793
+
794
+ # Build binaries
795
+ ./project/scripts/sbt "${sbtProject}/Universal/stage"
796
+
797
+ outputPath="${distDir}/target/universal/stage"
774
798
artifactName="scala3-${{ env.RELEASE_TAG }}${distroSuffix}"
799
+ zipArchive="${artifactName}.zip"
800
+ tarGzArchive="${artifactName}.tar.gz"
775
801
776
- downloadedArchive="./artifact.zip"
777
- if [[ -f "${downloadedArchive}" ]]; then
778
- rm "${downloadedArchive}"
779
- fi
780
-
781
- # Download previously prepared SDK bundle
782
- curl -L \
783
- -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
784
- -H "Accept: application/vnd.github+json" \
785
- -o "${downloadedArchive}" \
786
- --retry 5 --retry-delay 10 --retry-connrefused \
787
- --max-time 600 --connect-timeout 60 \
788
- https://api.github.com/repos/scala/scala3/actions/artifacts/${artifactId}/zip
789
-
790
- # Repackage content of .zip to .tar.gz and prepare digest
791
- tmpDir="./archive-tmp-dir"
792
- if [[ -d "${tmpDir}" ]]; then
793
- rm -r "${tmpDir}"
794
- fi
795
- mkdir "${tmpDir}"
796
- unzip "${downloadedArchive}" -d "${tmpDir}"
797
-
798
- mv "${downloadedArchive}" "./${artifactName}.zip"
799
- tar -czf "${artifactName}.tar.gz" -C "${tmpDir}" .
802
+ cwd=$(pwd)
803
+ (cd $outputPath && zip -r ${zipArchive} . && mv ${zipArchive} "${cwd}/")
804
+ tar -czf ${tarGzArchive} -C "$outputPath" .
800
805
801
806
# Caluclate SHA for each of archive files
802
- for file in "${artifactName}.zip " "${artifactName}.tar.gz "; do
807
+ for file in "${zipArchive} " "${tarGzArchive} "; do
803
808
sha256sum "${file}" > "${file}.sha256"
804
809
done
805
810
}
806
- prepareSDK "" ${{needs.build-sdk-package.outputs.universal-id}}
807
- prepareSDK "-aarch64-pc-linux" ${{needs.build-sdk-package.outputs. linux-aarch64-id}}
808
- prepareSDK "-x86_64-pc-linux" ${{needs.build-sdk-package.outputs. linux-x86_64-id}}
809
- prepareSDK "-aarch64-apple-darwin" ${{needs.build-sdk-package.outputs. mac-aarch64-id}}
810
- prepareSDK "-x86_64-apple-darwin" ${{needs.build-sdk-package.outputs. mac-x86_64-id}}
811
- prepareSDK "-x86_64-pc-win32" ${{needs.build-sdk-package.outputs. win-x86_64-id}}
811
+ prepareSDK "" "dist" "./dist/"
812
+ prepareSDK "-aarch64-pc-linux" "dist-linux-aarch64" "./dist/ linux-aarch64/"
813
+ prepareSDK "-x86_64-pc-linux" "dist-linux-x86_64" "./dist/ linux-x86_64/"
814
+ prepareSDK "-aarch64-apple-darwin" "dist-mac-aarch64" "./dist/ mac-aarch64/"
815
+ prepareSDK "-x86_64-apple-darwin" "dist-mac-x86_64" "./dist/ mac-x86_64/"
816
+ prepareSDK "-x86_64-pc-win32" "dist-win-x86_64" "./dist/ win-x86_64/"
812
817
813
818
# Create the GitHub release
814
819
- name : Create GitHub Release
@@ -850,7 +855,7 @@ jobs:
850
855
# template("Linux x86-64", "-x86_64-pc-linux"),
851
856
# template("Linux aarch64", "-aarch64-pc-linux"),
852
857
# template("Mac x86-64", "-x86_64-apple-darwin"),
853
- # template("Mac aarch64", "-aarcb64 -apple-darwin"),
858
+ # template("Mac aarch64", "-aarch64 -apple-darwin"),
854
859
# template("Windows x86_64", "-x86_64-pc-win32")
855
860
# ).foreach(println)
856
861
# Universal
@@ -1016,35 +1021,35 @@ jobs:
1016
1021
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1017
1022
with :
1018
1023
upload_url : ${{ steps.create_gh_release.outputs.upload_url }}
1019
- asset_path : ./scala3-${{ env.RELEASE_TAG }}-aarcb64 -apple-darwin.zip
1020
- asset_name : scala3-${{ env.RELEASE_TAG }}-aarcb64 -apple-darwin.zip
1024
+ asset_path : ./scala3-${{ env.RELEASE_TAG }}-aarch64 -apple-darwin.zip
1025
+ asset_name : scala3-${{ env.RELEASE_TAG }}-aarch64 -apple-darwin.zip
1021
1026
asset_content_type : application/zip
1022
1027
- name : Upload zip archive SHA to GitHub Release (Mac aarch64)
1023
1028
uses : actions/upload-release-asset@v1
1024
1029
env :
1025
1030
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1026
1031
with :
1027
1032
upload_url : ${{ steps.create_gh_release.outputs.upload_url }}
1028
- asset_path : ./scala3-${{ env.RELEASE_TAG }}-aarcb64 -apple-darwin.zip.sha256
1029
- asset_name : scala3-${{ env.RELEASE_TAG }}-aarcb64 -apple-darwin.zip.sha256
1033
+ asset_path : ./scala3-${{ env.RELEASE_TAG }}-aarch64 -apple-darwin.zip.sha256
1034
+ asset_name : scala3-${{ env.RELEASE_TAG }}-aarch64 -apple-darwin.zip.sha256
1030
1035
asset_content_type : text/plain
1031
1036
- name : Upload tar.gz archive to GitHub Release (Mac aarch64)
1032
1037
uses : actions/upload-release-asset@v1
1033
1038
env :
1034
1039
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1035
1040
with :
1036
1041
upload_url : ${{ steps.create_gh_release.outputs.upload_url }}
1037
- asset_path : ./scala3-${{ env.RELEASE_TAG }}-aarcb64 -apple-darwin.tar.gz
1038
- asset_name : scala3-${{ env.RELEASE_TAG }}-aarcb64 -apple-darwin.tar.gz
1042
+ asset_path : ./scala3-${{ env.RELEASE_TAG }}-aarch64 -apple-darwin.tar.gz
1043
+ asset_name : scala3-${{ env.RELEASE_TAG }}-aarch64 -apple-darwin.tar.gz
1039
1044
asset_content_type : application/gzip
1040
1045
- name : Upload tar.gz archive SHA to GitHub Release (Mac aarch64)
1041
1046
uses : actions/upload-release-asset@v1
1042
1047
env :
1043
1048
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1044
1049
with :
1045
1050
upload_url : ${{ steps.create_gh_release.outputs.upload_url }}
1046
- asset_path : ./scala3-${{ env.RELEASE_TAG }}-aarcb64 -apple-darwin.tar.gz.sha256
1047
- asset_name : scala3-${{ env.RELEASE_TAG }}-aarcb64 -apple-darwin.tar.gz.sha256
1051
+ asset_path : ./scala3-${{ env.RELEASE_TAG }}-aarch64 -apple-darwin.tar.gz.sha256
1052
+ asset_name : scala3-${{ env.RELEASE_TAG }}-aarch64 -apple-darwin.tar.gz.sha256
1048
1053
asset_content_type : text/plain
1049
1054
1050
1055
0 commit comments