Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 0c63b8d

Browse files
authored
feat: polish for marketplace (#1)
1 parent 8977638 commit 0c63b8d

File tree

5 files changed

+62
-14
lines changed

5 files changed

+62
-14
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# these are just here to test the Action
2+
test/** -linguist-detectable

.github/workflows/test.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
uses: ./
2424

2525
- name: Test basic usage
26-
shell: bash
2726
run: deno run -A ./test/basic/main.ts
2827

2928
customized:
@@ -44,9 +43,7 @@ jobs:
4443
with:
4544
deno-version: 1.x
4645
deno-lock-path: "test/customized/deno.lock"
47-
deno-json-path: "test/customized/deno.json"
4846
scripts-dir: "test/customized/"
4947

5048
- name: Test customized usage
51-
shell: bash
52-
run: deno run -A --config ./test/customized/deno.json ./test/customized/main.ts
49+
run: deno run -A --config=./test/customized/deno.json ./test/customized/main.ts

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 nekowinston
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# setup-deno
2+
3+
[![Test the action](https://github.com/nekowinston/setup-deno/actions/workflows/test.yml/badge.svg)](https://github.com/nekowinston/setup-deno/actions/workflows/test.yml)
4+
5+
### Deno Setup action with integrated cache.
6+
7+
Based on `denoland/setup-deno@v1`, & `actions/cache@v3`, handles `DENO_DIR` and caching for you.\
8+
Works on Ubuntu, macOS & Windows runners.
9+
10+
### Inputs
11+
- `deno-version`:\
12+
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.
13+
Defaults to `1.x`.
14+
- `deno-json-path`:\
15+
The path to the Deno config file to use for caching.\
16+
Defaults to an empty string, using the built-in CLI default.
17+
- `deno-lock-path`:\
18+
The path to the lock file to use for caching.\
19+
Defaults to `./deno.lock`.
20+
- `scripts-dir`:\
21+
The path to the scripts to cache. This can be useful if Deno is only part of your repo, and stored in a subdirectory.\
22+
Defaults to the repo root.
23+
24+
### Outputs:
25+
- `deno-version`: The Deno version that was installed.
26+
- `is-canary`: If the installed Deno version was a canary version.
27+
- `cache-hit`: A boolean value to indicate an exact match was found for the key.

action.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: "Setup Deno with cache"
2-
32
description: "Composite action wrapper around denoland/setup-deno and actions/cache to setup Deno and cache its dependencies."
3+
branding:
4+
icon: fast-forward
5+
color: gray-dark
46

57
inputs:
68
deno-version:
@@ -13,7 +15,7 @@ inputs:
1315
description: "The path to the lock file to use for caching. Defaults to `./deno.lock`."
1416
default: "./deno.lock"
1517
scripts-dir:
16-
description: "The path to the scripts to cache. Defaults to the repo root (`.`)."
18+
description: "The path to the scripts to cache. Defaults to the repo root."
1719
default: "."
1820

1921
outputs:
@@ -23,6 +25,9 @@ outputs:
2325
is-canary:
2426
description: "If the installed Deno version was a canary version."
2527
value: ${{ steps.setup-deno.outputs.is-canary }}
28+
cache-hit:
29+
description: "A boolean value to indicate an exact match was found for the key."
30+
value: ${{ steps.cache-deno.outputs.cache-hit }}
2631

2732
runs:
2833
using: "composite"
@@ -38,20 +43,16 @@ runs:
3843
run: echo "DENO_DIR=${{ runner.os == 'Windows' && 'C:\\deno_cache' || '/tmp/deno_cache' }}" >> $GITHUB_ENV
3944

4045
- name: Cache Deno dependencies
46+
id: cache-deno
4147
uses: actions/cache@v3
4248
with:
4349
key: ${{ hashFiles(inputs.deno-lock-path) }}
4450
path: ${{ env.DENO_DIR }}
4551

46-
- name: Install GNU findutils
47-
if: runner.os == 'macOS'
48-
shell: bash
49-
run: brew install findutils
50-
5152
- name: Restore Deno dependencies
5253
shell: bash
5354
run: |
54-
export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"
55-
find ${{ inputs.scripts-path }} \
55+
find ${{ runner.os == 'macOS' && '-E' || '' }} \
56+
${{ inputs.scripts-dir }} \
5657
-regex '.+\.[tj]sx?$' \
57-
-exec deno cache {} ${{ inputs.deno-config-path != '' && '--config=' || '' }}${{ inputs.deno-config-path }} \;
58+
-exec deno cache {} ${{ inputs.deno-json-path != '' && '--config=' || '' }}${{ inputs.deno-json-path }} \;

0 commit comments

Comments
 (0)