forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'lts-3.3' into scala-lts-3.3
- Loading branch information
Showing
29 changed files
with
834 additions
and
75 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,57 @@ | ||
################################################################################################### | ||
### 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 | ||
digest: | ||
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: Replace the CHECKSUM placeholder | ||
uses: richardrigutins/replace-in-files@v2 | ||
with: | ||
files: ./pkgs/chocolatey/tools/chocolateyInstall.ps1 | ||
search-text: '@LAUNCHER_SHA256@' | ||
replacement-text: ${{ inputs.digest }} | ||
- 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,58 @@ | ||
################################################################################################### | ||
### 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 }} | ||
universal-digest: | ||
description: The SHA256 of the uploaded artifact (universal) | ||
value : ${{ jobs.build.outputs.universal-digest }} | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
universal-id : ${{ steps.universal.outputs.artifact-id }} | ||
universal-digest : ${{ steps.universal-digest.outputs.digest }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: ${{ inputs.java-version }} | ||
cache : sbt | ||
- uses: sbt/setup-sbt@v1 | ||
- name: Build and pack the SDK (universal) | ||
run : ./project/scripts/sbt dist/pack | ||
|
||
- name: Upload zip archive to GitHub Artifact (universal) | ||
uses: actions/upload-artifact@v4 | ||
id : universal | ||
with: | ||
path: ./dist/target/pack/* | ||
name: scala3-universal | ||
|
||
- name: Compute SHA256 of the uploaded artifact (universal) | ||
id : universal-digest | ||
run : | | ||
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -o artifact.zip -L https://api.github.com/repos/scala/scala3/actions/artifacts/${{ steps.universal.outputs.artifact-id }}/zip | ||
echo "digest=$(sha256sum artifact.zip | cut -d " " -f 1)" >> "$GITHUB_OUTPUT" |
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
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 }} | ||
|
Oops, something went wrong.