diff --git a/.github/workflows/build-sdk.yml b/.github/workflows/build-sdk.yml index 100fb1b2d6d9..90f1a086aaf0 100644 --- a/.github/workflows/build-sdk.yml +++ b/.github/workflows/build-sdk.yml @@ -13,10 +13,37 @@ run-name: Build Scala Launchers on: workflow_call: + outputs: + universal-url: + description: URL to downloald the `universal` package from GitHub Artifacts (Authentication Required) + value : ${{ jobs.build.outputs.universal-url }} + linux-x86_64-url: + description: URL to downloald the `linux x86-64` package from GitHub Artifacts (Authentication Required) + value : ${{ jobs.build.outputs.linux-x86_64-url }} + linux-aarch64-url: + description: URL to downloald the `linux aarch64` package from GitHub Artifacts (Authentication Required) + value : ${{ jobs.build.outputs.linux-aarch64-url }} + mac-x86_64-url: + description: URL to downloald the `mac x86-64` package from GitHub Artifacts (Authentication Required) + value : ${{ jobs.build.outputs.mac-x86_64-url }} + mac-aarch64-url: + description: URL to downloald the `mac aarch64` package from GitHub Artifacts (Authentication Required) + value : ${{ jobs.build.outputs.mac-aarch64-url }} + win-x86_64-url: + description: URL to downloald the `win x86-64` package from GitHub Artifacts (Authentication Required) + value : ${{ jobs.build.outputs.win-x86_64-url }} + jobs: build: runs-on: ubuntu-latest + outputs: + universal-url : ${{ steps.universal.outputs.artifact-url }} + linux-x86_64-url : ${{ steps.linux-x86_64.outputs.artifact-url }} + linux-aarch64-url: ${{ steps.linux-aarch64.outputs.artifact-url }} + mac-x86_64-url : ${{ steps.mac-x86_64.outputs.artifact-url }} + mac-aarch64-url : ${{ steps.mac-aarch64.outputs.artifact-url }} + win-x86_64-url : ${{ steps.win-x86_64.outputs.artifact-url }} steps: - uses: actions/checkout@v4 - name: Build and pack the SDK (universal) @@ -33,31 +60,37 @@ jobs: run : ./project/scripts/sbt dist-win-x86_64/Universal/packageBin - name: Upload zip archive to GitHub Artifact (universal) uses: actions/upload-artifact@v4 + id : universal with: path: ./dist/target/universal/scala3-*.zip name: scala3.zip - name: Upload zip archive to GitHub Artifact (linux x86-64) uses: actions/upload-artifact@v4 + id : linux-x86_64 with: path: ./dist/linux-x86_64/target/universal/scala3-*-x86_64-pc-linux.zip name: scala3-x86_64-pc-linux.zip - name: Upload zip archive to GitHub Artifact (linux aarch64) uses: actions/upload-artifact@v4 + id : linux-aarch64 with: path: ./dist/linux-aarch64/target/universal/scala3-*-aarch64-pc-linux.zip name: scala3-aarch64-pc-linux.zip - name: Upload zip archive to GitHub Artifact (mac x86-64) uses: actions/upload-artifact@v4 + id : mac-x86_64 with: path: ./dist/mac-x86_64/target/universal/scala3-*-x86_64-apple-darwin.zip name: scala3-x86_64-apple-darwin.zip - name: Upload zip archive to GitHub Artifact (mac aarch64) uses: actions/upload-artifact@v4 + id : mac-aarch64 with: path: ./dist/mac-aarch64/target/universal/scala3-*-aarch64-apple-darwin.zip name: scala3-aarch64-apple-darwin.zip - name: Upload zip archive to GitHub Artifact (win x86-64) uses: actions/upload-artifact@v4 + id : win-x86_64 with: path: ./dist/win-x86_64/target/universal/scala3-*-x86_64-pc-win32.zip name: scala3-x86_64-pc-win32.zip diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 46f4fb738c96..2ab066a81315 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1023,7 +1023,7 @@ jobs: needs: [ build-sdk-package ] with: version: 3.6.0-RC1 # TODO: FIX THIS - url : 'https://github.com/scala/scala3/releases/download/3.5.0-RC4/scala3-3.5.0-RC4-x86_64-pc-win32.zip' # TODO: Fix this + url : ${{ needs.build-sdk-package.outputs.win-x86_64-url }} test-chocolatey-package: uses: ./.github/workflows/test-chocolatey.yml diff --git a/.github/workflows/test-chocolatey.yml b/.github/workflows/test-chocolatey.yml index 898580cdd5b6..a7b189ba2243 100644 --- a/.github/workflows/test-chocolatey.yml +++ b/.github/workflows/test-chocolatey.yml @@ -31,6 +31,8 @@ jobs: - name : Install the `scala` package with Chocolatey run : choco install scala --source "${{ env.CHOCOLATEY-REPOSITORY }}" --pre # --pre since we might be testing non-stable releases shell: pwsh + env: + DOTTY_CI_INSTALLATION: ${{ secrets.GITHUB_TOKEN }} - name : Test the `scala` command run : scala --version shell: pwsh diff --git a/pkgs/chocolatey/tools/chocolateyInstall.ps1 b/pkgs/chocolatey/tools/chocolateyInstall.ps1 index c03d69b64095..65b03263dbae 100644 --- a/pkgs/chocolatey/tools/chocolateyInstall.ps1 +++ b/pkgs/chocolatey/tools/chocolateyInstall.ps1 @@ -11,6 +11,18 @@ $packageArgs = @{ UnzipLocation = $unzipLocation } +## In case we are running in the CI, add the authorisation header to fetch the zip +if ($env:DOTTY_CI_INSTALLATION) { + Write-Host "Installing the Chocolatey package in Scala 3's CI" + $packageArgs += @{ + Options = @{ + Headers = @{ + Authorization = "Bearer $env:DOTTY_CI_INSTALLATION" + } + } + } +} + Install-ChocolateyZipPackage @packageArgs $extractedDir = Get-ChildItem -Path $unzipLocation | Where-Object { $_.PSIsContainer } | Select-Object -First 1