Official release of Scala 3.6.2 #35
Workflow file for this run
This file contains 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
################################################################################################### | |
### OFFICIAL RELEASE WORKFLOW ### | |
### HOW TO USE: ### | |
### - THIS WORKFLOW WILL NEED TO BE TRIGGERED MANUALLY ### | |
### ### | |
### NOTE: ### | |
### - THIS WORKFLOW SHOULD ONLY BE RUN ON STABLE RELEASES ### | |
### - IT ASSUMES THAT THE PRE-RELEASE WORKFLOW WAS PREVIOUSLY EXECUTED ### | |
### ### | |
################################################################################################### | |
name: Official release of Scala | |
run-name: Official release of Scala ${{ inputs.version }} | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'The version to officially release' | |
required: true | |
type: string | |
jobs: | |
republish_artifacts: | |
permissions: | |
contents: write # for GH CLI to create a release | |
runs-on: [self-hosted, Linux] | |
container: | |
image: lampepfl/dotty:2024-10-18 | |
options: --cpu-shares 4096 | |
volumes: | |
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt | |
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache | |
- ${{ github.workspace }}/../../cache/general:/root/.cache | |
env: | |
RELEASEBUILD: yes | |
steps: | |
###################################################################################### | |
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA IS DISTRIBUTED USING JAVA 8. ## | |
###################################################################################### | |
- name: Set JDK 8 as default | |
run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH | |
- name: Reset existing repo | |
run: | | |
git config --global --add safe.directory /__w/scala3/scala3 | |
git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true | |
- name: Checkout cleanup script | |
uses: actions/checkout@v4 | |
- name: Cleanup | |
run: .github/workflows/cleanup.sh | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
- name: Add SBT proxy repositories | |
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true | |
- name: Check compiler version | |
shell: bash | |
run : | | |
version=$(./project/scripts/sbt "print scala3-compiler-bootstrapped/version" | tail -n1) | |
echo "This build version: ${version}" | |
if [ "${version}" != "${{ inputs.version }}" ]; then | |
echo "Compiler version for this build '${version}', does not match tag: ${{ inputs.version }}" | |
exit 1 | |
fi | |
- name: Prepare the SDKs | |
shell: bash | |
run : | | |
git config --global --add safe.directory /__w/scala3/scala3 | |
prepareSDK() { | |
distroSuffix="$1" | |
sbtProject="$2" | |
distDir="$3" | |
# Build binaries | |
./project/scripts/sbt "all ${sbtProject}/Universal/packageBin ${sbtProject}/Universal/packageZipTarball" | |
outputPath="${distDir}/target/universal/stage" | |
artifactName="scala3-${{ inputs.version }}${distroSuffix}" | |
zipArchive="${artifactName}.zip" | |
tarGzArchive="${artifactName}.tar.gz" | |
# Caluclate SHA for each of archive files | |
for file in "${zipArchive}" "${tarGzArchive}"; do | |
mv $outputPath/$file $file | |
sha256sum "${file}" > "${file}.sha256" | |
done | |
} | |
prepareSDK "" "dist" "./dist/" | |
prepareSDK "-aarch64-pc-linux" "dist-linux-aarch64" "./dist/linux-aarch64/" | |
prepareSDK "-x86_64-pc-linux" "dist-linux-x86_64" "./dist/linux-x86_64/" | |
prepareSDK "-aarch64-apple-darwin" "dist-mac-aarch64" "./dist/mac-aarch64/" | |
prepareSDK "-x86_64-apple-darwin" "dist-mac-x86_64" "./dist/mac-x86_64/" | |
prepareSDK "-x86_64-pc-win32" "dist-win-x86_64" "./dist/win-x86_64/" | |
# - name: Download MSI package | |
# uses: actions/download-artifact@v4 | |
# with: | |
# name: scala.msi | |
# path: . | |
# - name: Prepare MSI package | |
# shell: bash | |
# run: | | |
# msiInstaller="scala3-${{ inputs.version }}.msi" | |
# mv scala.msi "${msiInstaller}" | |
# sha256sum "${msiInstaller}" > "${msiInstaller}.sha256" | |
- name: Install GH CLI | |
uses: dev-hanz-ops/[email protected] | |
with: | |
gh-cli-version: 2.59.0 | |
# Create the GitHub release | |
- name: Create GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
shell: bash | |
run: | | |
git config --global --add safe.directory /__w/scala3/scala3 | |
gh release upload ${{ inputs.version }} \ | |
--clobber \ | |
scala3-${{ inputs.version }}*.zip \ | |
scala3-${{ inputs.version }}*.tar.gz \ | |
scala3-${{ inputs.version }}*.sha256 | |
# scala3-${{ inputs.version }}.msi |