mirror of
https://gitea.com/actions/setup-deno.git
synced 2025-12-11 19:06:43 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
909cc5acb0 | ||
|
|
003ac26627 | ||
|
|
7c6ecb3883 | ||
|
|
01524fade7 | ||
|
|
b571f8c14c |
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
@@ -17,6 +17,7 @@ jobs:
|
||||
- macos-latest
|
||||
deno:
|
||||
- "1.x"
|
||||
- "2.x"
|
||||
- "1.33.1"
|
||||
- "canary"
|
||||
- "~1.32"
|
||||
|
||||
28
README.md
28
README.md
@@ -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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v1.x
|
||||
deno-version: v2.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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
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@v1
|
||||
- uses: denoland/setup-deno@v2
|
||||
id: deno
|
||||
with:
|
||||
deno-version: canary
|
||||
|
||||
21
deno-problem-matchers.json
Normal file
21
deno-problem-matchers.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "deno-lint",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(?:\\x1B\\[[0-9;]*[a-zA-Z])*(warning|warn|error)(?:\\[(\\S*)\\])?(?:\\x1B\\[[0-9;]*[a-zA-Z])*: (.*?)(?:\\x1B\\[[0-9;]*[a-zA-Z])*$",
|
||||
"severity": 1,
|
||||
"code": 2,
|
||||
"message": 3
|
||||
},
|
||||
{
|
||||
"regexp": "^(?:\\s*)(?:\\x1B\\[[0-9;]*[a-zA-Z])*-->(?:\\x1B\\[[0-9;]*[a-zA-Z])* (?:\\x1B\\[[0-9;]*[a-zA-Z])*(\\S+?)(?:\\x1B\\[[0-9;]*[a-zA-Z])*:(\\d+):(\\d+)(?:\\x1B\\[[0-9;]*[a-zA-Z])*$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
7
main.mjs
7
main.mjs
@@ -1,5 +1,6 @@
|
||||
import process from "node:process";
|
||||
import core from "@actions/core";
|
||||
import path from "node:path";
|
||||
import {
|
||||
getDenoVersionFromFile,
|
||||
parseVersionRange,
|
||||
@@ -38,6 +39,12 @@ async function main() {
|
||||
|
||||
await install(version);
|
||||
|
||||
core.info(
|
||||
`::add-matcher::${
|
||||
path.join(import.meta.dirname ?? ".", "deno-problem-matchers.json")
|
||||
}`,
|
||||
);
|
||||
|
||||
core.setOutput("deno-version", version.version);
|
||||
core.setOutput("release-channel", version.kind);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "setup-deno",
|
||||
"description": "Set up Deno easially in GitHub Actions",
|
||||
"version": "2.0.0",
|
||||
"description": "Set up Deno easily in GitHub Actions",
|
||||
"version": "2.0.2",
|
||||
"author": "Deno Land Inc",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
|
||||
@@ -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}.`);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ const GIT_HASH_RE = /^[0-9a-fA-F]{40}$/;
|
||||
* @returns {VersionRange | null}
|
||||
*/
|
||||
export function parseVersionRange(version) {
|
||||
version = String(version) || "1.x";
|
||||
version = String(version) || "2.x";
|
||||
version = version.trim();
|
||||
|
||||
if (version === "canary") {
|
||||
|
||||
Reference in New Issue
Block a user