From 9b75711c6a032ea83c0a159f6140d0c2f18f7d6b Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 19 Jan 2021 20:25:02 +0100 Subject: [PATCH 1/4] Support main (aka edge) builds --- setup.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 1b75710..1b749c9 100755 --- a/setup.sh +++ b/setup.sh @@ -3,7 +3,7 @@ ############################################################################### # 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| # +# $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 # @@ -23,7 +23,7 @@ CHANNEL= VERSION= # Check for a specific version -if [[ $SDK == stable || $SDK == beta || $SDK == dev ]] +if [[ $SDK == stable || $SDK == beta || $SDK == dev || $SDK == main ]] then CHANNEL=$SDK VERSION=latest @@ -37,6 +37,10 @@ else elif [[ "$SDK" == *"beta"* ]] then CHANNEL=beta + elif [[ "$SDK" == *"main"* ]] + then + echo -e "::error::Versions cannot be specified for builds from the main channel." + exit 1 fi fi @@ -48,7 +52,13 @@ echo "Installing Dart SDK version \"${VERSION}\" from the ${CHANNEL} channel on # Calculate download Url. Based on: # https://dart.dev/tools/sdk/archive#download-urls PREFIX="https://storage.googleapis.com/dart-archive/channels" -URL="${PREFIX}/${CHANNEL}/release/${VERSION}/sdk/dartsdk-${OS}-${ARCH}-release.zip" +BUILD="sdk/dartsdk-${OS}-${ARCH}-release.zip" +if [[ $SDK == main ]] +then + URL="${PREFIX}/be/raw/latest/${BUILD}" +else + URL="${PREFIX}/${CHANNEL}/release/${VERSION}/${BUILD}" +fi echo "Downloading ${URL}..." # Download installation zip. From 6e068705eddfdb683c73329e6c06b291dd670625 Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 19 Jan 2021 20:31:18 +0100 Subject: [PATCH 2/4] Add main to CI --- .github/workflows/dart.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 4bfa886..b3adb34 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -13,9 +13,9 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - # Test latest stable, beta, and dev channels + last stable release + # Test latest stable, beta, dev, and main channels + last stable release # prior to the introduction of the unified `dart` developer tool. - sdk: [stable, beta, dev, 2.9.3, 2.12.0-29.10.beta] + sdk: [stable, beta, dev, main, 2.9.3, 2.12.0-29.10.beta] steps: - uses: actions/checkout@v2 - uses: ./ From 584dd6fa8d86913c8829e2d4f6b468c8fef8ebeb Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 19 Jan 2021 20:41:13 +0100 Subject: [PATCH 3/4] Update readme --- README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 263a45f..2cf1708 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,17 @@ This [GitHub Action]() installs and sets up of a Dart SDK for use in actions by: # Usage -## Basic +## Inputs + +The action takes the following inputs: + + * `sdk`: Which SDK version to setup. Can be specified using one of two forms: + * A specific SDK version, e.g. `2.7.2` or `2.12.0-1.4.beta` + * A release channel, which will install the latest build from that channel. + Available channels are `stable`, `beta`, `dev`, and `main`. See + https://dart.dev/tools/sdk/archive for details. + +## Basic example Install the latest stable SDK, and run Hello World. @@ -37,7 +47,7 @@ jobs: run: dart bin/hello_world.dart ``` -## Check static analysis, formatting, and tests +## Check static analysis, formatting, and test example Various static checks: @@ -62,7 +72,7 @@ Various static checks: run: dart test ``` -## Matrix testing +## Matrix testing example You can create matrix jobs that run tests on multiple operating systems, and multiple versions of the Dart SDK. @@ -101,7 +111,7 @@ jobs: run: dart test ``` -## Testing older Dart SDKs +## Testing older Dart SDKs example The Dart SDK continously evolves, and new features and tools are added. The Dart 2.10 SDK introduced a new unified `dart` developer tool, which is what we use in From f7c7b45f103b5a3f4fde7fb0c6d5f9d34f1c9cfb Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 19 Jan 2021 21:51:50 +0100 Subject: [PATCH 4/4] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 2cf1708..b912a8d 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,10 @@ jobs: # Version history +## v0.3 + + * Added support for installing SDKs from the `main` channel. + ## v0.2 * Added support for installing a specific SDK version (e.g. `2.10.0`).