diff --git a/README.md b/README.md index 6db5f5e..8c89dc3 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,11 @@ The action takes the following inputs: supported on all operating systems; see https://dart.dev/tools/sdk/archive for valid combinations. + * `signed`: Whether to install signed SDK binaries (defaults to true). + Unsigned binaries may not work on all operating systems. This option is + exposed for core packages that need to test against unreleased dev SDKs that + are automatically rolled in to the flutter CI systems. + ## Basic example Install the latest stable SDK, and run Hello World. @@ -169,6 +174,9 @@ jobs: # Version history +## v1.1 + * Added support for installing unsigned dev SDKs. + ## v1.0 * Promoted to 1.0 stable. diff --git a/action.yml b/action.yml index 49a3c7f..bdaecc4 100644 --- a/action.yml +++ b/action.yml @@ -12,8 +12,12 @@ inputs: description: "The CPU architecture ('x64', 'ia32', 'arm', or 'arm64')." required: false default: "x64" + signed: + description: "Whether to install a signed or unsigned Dart SDK build. Used to install unpublished dev releases." + required: false + default: true runs: using: "composite" steps: - - run: $GITHUB_ACTION_PATH/setup.sh ${{ inputs.sdk }} ${{ runner.os }} ${{ inputs.architecture }} + - run: $GITHUB_ACTION_PATH/setup.sh ${{ inputs.sdk }} ${{ runner.os }} ${{ inputs.architecture }} ${{inputs.signed }} shell: bash diff --git a/setup.sh b/setup.sh index 6a0334e..fefbe11 100755 --- a/setup.sh +++ b/setup.sh @@ -9,14 +9,15 @@ # Bash script that downloads and does setup for a Dart SDK. # # Takes three params; first listed is the default: # # $1: Dart SDK version/channel: stable|beta|dev|main| # -# $2: Dart channel (DEPRECATED): stable|beta|dev # -# $3: OS: Linux|Windows|macOS # -# $4: ARCH: x64|ia32 # +# $2: OS: Linux|Windows|macOS # +# $3: ARCH: x64|ia32 # +# $4: SIGNED: true|false (optional, defaults to true) # ############################################################################### # Parse SDK and version args. SDK="${1:-stable}" VERSION= +SIGNED="${4:-true}" if [[ $SDK == stable || $SDK == beta || $SDK == dev || $SDK == main ]] then CHANNEL=$SDK @@ -47,12 +48,14 @@ echo "Installing Dart SDK version \"${VERSION}\" from the ${CHANNEL} channel on # https://dart.dev/tools/sdk/archive#download-urls PREFIX="https://storage.googleapis.com/dart-archive/channels" BUILD="sdk/dartsdk-${OS}-${ARCH}-release.zip" -if [[ $SDK == main ]] +CHANNEL_FOLDER="${CHANNEL/main/be}" +if [[ $SIGNED == false || $SDK == main ]] then - URL="${PREFIX}/be/raw/latest/${BUILD}" + BINARIES_FOLDER=raw else - URL="${PREFIX}/${CHANNEL}/release/${VERSION}/${BUILD}" + BINARIES_FOLDER=release fi +URL="${PREFIX}/${CHANNEL_FOLDER}/${BINARIES_FOLDER}/${VERSION}/${BUILD}" echo "Downloading ${URL}..." # Download installation zip.