Skip to content

Support for downloading unsigned dev builds. #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -169,6 +174,9 @@ jobs:

# Version history

## v1.1
* Added support for installing unsigned dev SDKs.

## v1.0
* Promoted to 1.0 stable.

Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 9 additions & 6 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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|<version_string> #
# $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
Expand Down Expand Up @@ -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.
Expand Down