Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
705032ffe3 | ||
|
|
dd174af50e | ||
|
|
cb10b944b3 | ||
|
|
01e07c2140 | ||
|
|
f482eca5c4 | ||
|
|
3a3e838dbb |
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -25,4 +25,4 @@ jobs:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Try bun
|
||||
run: bun --help
|
||||
run: bun add types
|
||||
@@ -8,7 +8,7 @@ Set up your GitHub Actions workflow with a specific version of Bun.
|
||||
### Latest stable
|
||||
|
||||
```yaml
|
||||
- uses: xhyrom/setup-bun@v1
|
||||
- uses: xhyrom/setup-bun@v0.1.0
|
||||
with:
|
||||
bun-version: latest
|
||||
```
|
||||
@@ -16,7 +16,7 @@ Set up your GitHub Actions workflow with a specific version of Bun.
|
||||
### Specific version
|
||||
|
||||
```yaml
|
||||
- uses: xhyrom/setup-bun@v1
|
||||
- uses: xhyrom/setup-bun@v0.1.0
|
||||
with:
|
||||
bun-version: "0.1.2"
|
||||
```
|
||||
```
|
||||
|
||||
2
dist/index.js
vendored
2
dist/index.js
vendored
@@ -16,7 +16,7 @@ const main = async () => {
|
||||
return exit('Invalid bun version.');
|
||||
info(`Going to install release ${release.tag_name}`);
|
||||
await install(release);
|
||||
setOutput('deno-version', release.tag_name);
|
||||
setOutput('bun-version', release.tag_name);
|
||||
}
|
||||
catch (e) {
|
||||
exit(e);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"name": "setup-bun",
|
||||
"main": "dist/index.js",
|
||||
"type": "module",
|
||||
@@ -15,4 +15,4 @@
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"node-fetch": "^3.2.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
10
src/index.ts
10
src/index.ts
@@ -11,20 +11,20 @@ const main = async() => {
|
||||
try {
|
||||
const version = getInput('bun-version');
|
||||
const token = getInput('github-token');
|
||||
|
||||
|
||||
if (!version) return exit('Invalid bun version.');
|
||||
|
||||
const release = await getGithubRelease(version, token);
|
||||
if (release?.message === 'Not Found') return exit('Invalid bun version.');
|
||||
|
||||
info(`Going to install release ${release.tag_name}`);
|
||||
|
||||
|
||||
await install(release);
|
||||
|
||||
setOutput('deno-version', release.tag_name);
|
||||
|
||||
setOutput('bun-version', release.tag_name);
|
||||
} catch(e) {
|
||||
exit(e);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
main();
|
||||
|
||||
Reference in New Issue
Block a user