Skip to content

Commit

Permalink
Update sdkman release workflow - don't set LTS versions as default ca…
Browse files Browse the repository at this point in the history
…ndidates. Pass explicitlly version of Scala to release instead of latest one
  • Loading branch information
WojciechMazur committed Sep 27, 2024
1 parent 9eb858b commit 1e8f606
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Releases
on:
workflow_dispatch:
inputs:
version:
description: 'The version to officially release'
required: true
type: string

permissions:
contents: read
Expand Down Expand Up @@ -29,4 +34,4 @@ jobs:
uses: actions/checkout@v4

- name: Publish to SDKMAN
run: .github/workflows/scripts/publish-sdkman.sh
run: .github/workflows/scripts/publish-sdkman.sh ${{ inputs.version }}
29 changes: 15 additions & 14 deletions .github/workflows/scripts/publish-sdkman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
set -u

# latest stable dotty version
DOTTY_VERSION=$(curl -s https://api.github.com/repos/lampepfl/dotty/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
DOTTY_VERSION=$1
DOTTY_URL="https://github.com/lampepfl/dotty/releases/download/$DOTTY_VERSION/scala3-$DOTTY_VERSION.zip"

# checking if dotty version is available
Expand All @@ -34,17 +34,18 @@ if [[ $? -ne 0 ]]; then
exit 1
fi

# We don't set LTS versions as default candidates, we prefer Next instead
# Set DOTTY_VERSION as Default for Candidate
curl --silent --show-error --fail \
-X PUT \
-H "Consumer-Key: $SDKMAN_KEY" \
-H "Consumer-Token: $SDKMAN_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"candidate": "scala", "version": "'"$DOTTY_VERSION"'"}' \
https://vendors.sdkman.io/default

if [[ $? -ne 0 ]]; then
echo "Fail sending PUT request to announcing the release of scala on SDKMAN."
exit 1
fi
# curl --silent --show-error --fail \
# -X PUT \
# -H "Consumer-Key: $SDKMAN_KEY" \
# -H "Consumer-Token: $SDKMAN_TOKEN" \
# -H "Content-Type: application/json" \
# -H "Accept: application/json" \
# -d '{"candidate": "scala", "version": "'"$DOTTY_VERSION"'"}' \
# https://vendors.sdkman.io/default

# if [[ $? -ne 0 ]]; then
# echo "Fail sending PUT request to announcing the release of scala on SDKMAN."
# exit 1
# fi

0 comments on commit 1e8f606

Please sign in to comment.