-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78cb999
commit 0c1048a
Showing
6 changed files
with
285 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
################################################################################################### | ||
### THIS IS A REUSABLE WORKFLOW TO BUILD SCALA WITH CHOCOLATEY ### | ||
### HOW TO USE: ### | ||
### ### | ||
### NOTE: ### | ||
### ### | ||
################################################################################################### | ||
|
||
|
||
name: Build 'scala' Chocolatey Package | ||
run-name: Build 'scala' (${{ inputs.version }}) Chocolatey Package | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
url: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Replace the version placeholder | ||
uses: richardrigutins/replace-in-files@v2 | ||
with: | ||
files: ./pkgs/chocolatey/scala.nuspec | ||
search-text: '@LAUNCHER_VERSION@' | ||
replacement-text: ${{ inputs.version }} | ||
- name: Replace the URL placeholder | ||
uses: richardrigutins/replace-in-files@v2 | ||
with: | ||
files: ./pkgs/chocolatey/tools/chocolateyInstall.ps1 | ||
search-text: '@LAUNCHER_URL@' | ||
replacement-text: ${{ inputs.url }} | ||
- name: Build the Chocolatey package (.nupkg) | ||
run: choco pack ./pkgs/chocolatey/scala.nuspec --out ./pkgs/chocolatey | ||
- name: Upload the Chocolatey package to GitHub | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: scala.nupkg | ||
path: ./pkgs/chocolatey/scala.${{ inputs.version }}.nupkg | ||
if-no-files-found: error | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
################################################################################################### | ||
### THIS IS A REUSABLE WORKFLOW TO BUILD THE SCALA LAUNCHERS ### | ||
### HOW TO USE: ### | ||
### - THSI WORKFLOW WILL PACKAGE THE ALL THE LAUNCHERS AND UPLOAD THEM TO GITHUB ARTIFACTS ### | ||
### ### | ||
### NOTE: ### | ||
### - SEE THE WORFLOW FOR THE NAMES OF THE ARTIFACTS ### | ||
################################################################################################### | ||
|
||
|
||
name: Build Scala Launchers | ||
run-name: Build Scala Launchers | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
java-version: | ||
type : string | ||
required : true | ||
outputs: | ||
universal-id: | ||
description: ID of the `universal` package from GitHub Artifacts (Authentication Required) | ||
value : ${{ jobs.build.outputs.universal-id }} | ||
linux-x86_64-id: | ||
description: ID of the `linux x86-64` package from GitHub Artifacts (Authentication Required) | ||
value : ${{ jobs.build.outputs.linux-x86_64-id }} | ||
linux-aarch64-id: | ||
description: ID of the `linux aarch64` package from GitHub Artifacts (Authentication Required) | ||
value : ${{ jobs.build.outputs.linux-aarch64-id }} | ||
mac-x86_64-id: | ||
description: ID of the `mac x86-64` package from GitHub Artifacts (Authentication Required) | ||
value : ${{ jobs.build.outputs.mac-x86_64-id }} | ||
mac-aarch64-id: | ||
description: ID of the `mac aarch64` package from GitHub Artifacts (Authentication Required) | ||
value : ${{ jobs.build.outputs.mac-aarch64-id }} | ||
win-x86_64-id: | ||
description: ID of the `win x86-64` package from GitHub Artifacts (Authentication Required) | ||
value : ${{ jobs.build.outputs.win-x86_64-id }} | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
universal-id : ${{ steps.universal.outputs.artifact-id }} | ||
linux-x86_64-id : ${{ steps.linux-x86_64.outputs.artifact-id }} | ||
linux-aarch64-id: ${{ steps.linux-aarch64.outputs.artifact-id }} | ||
mac-x86_64-id : ${{ steps.mac-x86_64.outputs.artifact-id }} | ||
mac-aarch64-id : ${{ steps.mac-aarch64.outputs.artifact-id }} | ||
win-x86_64-id : ${{ steps.win-x86_64.outputs.artifact-id }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: ${{ inputs.java-version }} | ||
cache : sbt | ||
- name: Build and pack the SDK (universal) | ||
run : ./project/scripts/sbt dist/Universal/stage | ||
- name: Build and pack the SDK (linux x86-64) | ||
run : ./project/scripts/sbt dist-linux-x86_64/Universal/stage | ||
- name: Build and pack the SDK (linux aarch64) | ||
run : ./project/scripts/sbt dist-linux-aarch64/Universal/stage | ||
- name: Build and pack the SDK (mac x86-64) | ||
run : ./project/scripts/sbt dist-mac-x86_64/Universal/stage | ||
- name: Build and pack the SDK (mac aarch64) | ||
run : ./project/scripts/sbt dist-mac-aarch64/Universal/stage | ||
- name: Build and pack the SDK (win x86-64) | ||
run : ./project/scripts/sbt dist-win-x86_64/Universal/stage | ||
- name: Upload zip archive to GitHub Artifact (universal) | ||
uses: actions/upload-artifact@v4 | ||
id : universal | ||
with: | ||
path: ./dist/target/universal/stage | ||
name: scala3-universal | ||
- 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/stage | ||
name: scala3-x86_64-pc-linux | ||
- name: Upload zip archive to GitHub Artifact (linux aarch64) | ||
uses: actions/upload-artifact@v4 | ||
id : linux-aarch64 | ||
with: | ||
path: ./dist/linux-aarch64/target/universal/stage | ||
name: scala3-aarch64-pc-linux | ||
- 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/stage | ||
name: scala3-x86_64-apple-darwin | ||
- name: Upload zip archive to GitHub Artifact (mac aarch64) | ||
uses: actions/upload-artifact@v4 | ||
id : mac-aarch64 | ||
with: | ||
path: ./dist/mac-aarch64/target/universal/stage | ||
name: scala3-aarch64-apple-darwin | ||
- 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/stage | ||
name: scala3-x86_64-pc-win32 | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
################################################################################################### | ||
### THIS IS A REUSABLE WORKFLOW TO PUBLISH SCALA TO CHOCOLATEY ### | ||
### HOW TO USE: ### | ||
### - THE RELEASE WORKFLOW SHOULD CALL THIS WORKFLOW ### | ||
### - IT WILL PUBLISH TO CHOCOLATEY THE MSI ### | ||
### ### | ||
### NOTE: ### | ||
### - WE SHOULD KEEP IN SYNC THE NAME OF THE MSI WITH THE ACTUAL BUILD ### | ||
### - WE SHOULD KEEP IN SYNC THE URL OF THE RELEASE ### | ||
### - IT ASSUMES THAT THE `build-chocolatey` WORKFLOW WAS EXECUTED BEFORE ### | ||
################################################################################################### | ||
|
||
|
||
name: Publish Scala to Chocolatey | ||
run-name: Publish Scala ${{ inputs.version }} to Chocolatey | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
secrets: | ||
# Connect to https://community.chocolatey.org/profiles/scala | ||
# Accessible via https://community.chocolatey.org/account | ||
API-KEY: | ||
required: true | ||
|
||
jobs: | ||
publish: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Fetch the Chocolatey package from GitHub | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: scala.nupkg | ||
- name: Publish the package to Chocolatey | ||
run: choco push scala.nupkg --source https://push.chocolatey.org/ --api-key ${{ secrets.API-KEY }} | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
################################################################################################### | ||
### THIS IS A REUSABLE WORKFLOW TO TEST SCALA WITH CHOCOLATEY ### | ||
### HOW TO USE: ### | ||
### ### | ||
### NOTE: ### | ||
### ### | ||
################################################################################################### | ||
|
||
name: Test 'scala' Chocolatey Package | ||
run-name: Test 'scala' (${{ inputs.version }}) Chocolatey Package | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
java-version: | ||
required: true | ||
type : string | ||
|
||
env: | ||
CHOCOLATEY-REPOSITORY: chocolatey-pkgs | ||
DOTTY_CI_INSTALLATION: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
test: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: ${{ inputs.java-version }} | ||
- name: Download the 'nupkg' from GitHub Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: scala.nupkg | ||
path: ${{ env.CHOCOLATEY-REPOSITORY }} | ||
- 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 | ||
- name : Test the `scala` command | ||
run : scala --version | ||
shell: pwsh | ||
- name : Test the `scalac` command | ||
run : scalac --version | ||
- name : Test the `scaladoc` command | ||
run : scaladoc --version | ||
- name : Test the `scala-cli` command | ||
run : scala-cli --version | ||
- name : Uninstall the `scala` package | ||
run : choco uninstall scala | ||
|