2 Commits

Author SHA1 Message Date
crowlkats
11b63cf76c 1.5.2 2025-01-09 22:17:00 +01:00
Leo Kettmeir
553a648212 refactor: use GitHub downloads for stable version download (#91)
(cherry picked from commit 5e036d05d8)
2025-01-09 22:09:52 +01:00
7 changed files with 35 additions and 21 deletions

View File

@@ -17,7 +17,6 @@ jobs:
- macos-latest
deno:
- "1.x"
- "2.x"
- "1.33.1"
- "canary"
- "~1.32"

View File

@@ -7,9 +7,9 @@ Set up your GitHub Actions workflow with a specific version of Deno.
### Latest stable for a major
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
with:
deno-version: v2.x
deno-version: v1.x
```
### Latest stable for any major
@@ -17,7 +17,7 @@ Set up your GitHub Actions workflow with a specific version of Deno.
Targets the latest major, minor and patch version of Deno.
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x
```
@@ -25,7 +25,7 @@ Targets the latest major, minor and patch version of Deno.
### Specific stable
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
with:
deno-version: "1.8.2"
```
@@ -33,7 +33,7 @@ Targets the latest major, minor and patch version of Deno.
### Semver range
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
with:
deno-version: "~1.7"
```
@@ -41,7 +41,7 @@ Targets the latest major, minor and patch version of Deno.
### Latest canary
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
with:
deno-version: canary
```
@@ -49,7 +49,7 @@ Targets the latest major, minor and patch version of Deno.
### Specific canary
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
with:
deno-version: e7b7129b7a92b7500ded88f8f5baa25a7f59e56e
```
@@ -57,7 +57,7 @@ Targets the latest major, minor and patch version of Deno.
### Latest release candidate
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
with:
deno-version: rc
```
@@ -65,7 +65,7 @@ Targets the latest major, minor and patch version of Deno.
### Specific release candidate
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
with:
deno-version: 2.0.0-rc.1
```
@@ -76,7 +76,7 @@ The extension can also automatically read the version file from
[`.tool-versions`](https://asdf-vm.com/manage/configuration.html#tool-versions)
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
with:
deno-version-file: .tool-versions
```
@@ -85,7 +85,7 @@ The extension can also automatically read the file from
[`dvm`](https://github.com/justjavac/dvm).
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
with:
deno-version-file: .dvmrc
```
@@ -95,7 +95,7 @@ The extension can also automatically read the file from
This is useful when you want to install different versions of Deno side by side.
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
with:
deno-version: canary
deno-binary-name: deno_canary
@@ -108,7 +108,7 @@ You can determine the release channel reading back the `release-channel` output.
Valid values are `stable`, `canary` and `rc`.
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
id: deno
with:
deno-version: canary
@@ -126,7 +126,7 @@ For stable and rc versions, the output will be the regular semver version
number.
```yaml
- uses: denoland/setup-deno@v2
- uses: denoland/setup-deno@v1
id: deno
with:
deno-version: canary

View File

@@ -7,7 +7,7 @@ branding:
inputs:
deno-version:
description: The Deno version to install. Can be a semver version of a stable release, "canary" for the latest canary, or the Git hash of a specific canary release.
default: "2.x"
default: "1.x"
deno-version-file:
description: File containing the Deno version to install such as .dvmrc or .tool-versions.
deno-binary-name:
@@ -16,6 +16,8 @@ inputs:
outputs:
deno-version:
description: "The Deno version that was installed."
is-canary:
description: "If the installed Deno version was a canary version."
release-channel:
description: "The release channel of the installed version."
runs:

View File

@@ -39,6 +39,8 @@ async function main() {
await install(version);
core.setOutput("deno-version", version.version);
// TODO(@crowlKats): remove in 2.0
core.setOutput("is-canary", version.kind === "canary");
core.setOutput("release-channel", version.kind);
core.info("Installation complete.");

View File

@@ -1,7 +1,7 @@
{
"name": "setup-deno",
"description": "Set up Deno easially in GitHub Actions",
"version": "2.0.1",
"version": "1.5.2",
"author": "Deno Land Inc",
"license": "MIT",
"type": "module",

View File

@@ -20,9 +20,20 @@ export async function install(version) {
}
const zip = zipName();
const url = version.kind === "canary"
? `https://dl.deno.land/canary/${version.version}/${zip}`
: `https://dl.deno.land/release/v${version.version}/${zip}`;
let url;
switch (version.kind) {
case "canary":
url = `https://dl.deno.land/canary/${version.version}/${zip}`;
break;
case "rc":
url = `https://dl.deno.land/release/v${version.version}/${zip}`;
break;
case "stable":
url =
`https://github.com/denoland/deno/releases/download/v${version.version}/${zip}`;
break;
}
core.info(`Downloading Deno from ${url}.`);

View File

@@ -23,7 +23,7 @@ const GIT_HASH_RE = /^[0-9a-fA-F]{40}$/;
* @returns {VersionRange | null}
*/
export function parseVersionRange(version) {
version = String(version) || "2.x";
version = String(version) || "1.x";
version = version.trim();
if (version === "canary") {