mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-02-23 02:30:26 +08:00
feat: canary support
This commit is contained in:
parent
a0f9c413e5
commit
37397a08ec
@ -21,11 +21,10 @@ Set up your GitHub Actions workflow with a specific version of Bun.
|
||||
bun-version: "0.1.3"
|
||||
```
|
||||
|
||||
### Test builds
|
||||
### Canary builds
|
||||
|
||||
```yaml
|
||||
- uses: xhyrom/setup-bun@v0.1.3
|
||||
with:
|
||||
bun-version: latest
|
||||
misc-test-builds: true
|
||||
bun-version: canary
|
||||
```
|
||||
|
2
dist/utils/getGithubRelease.js
vendored
2
dist/utils/getGithubRelease.js
vendored
@ -5,7 +5,7 @@ export default async (version, token, miscTestBuilds) => {
|
||||
if (version === 'latest' || miscTestBuilds)
|
||||
url = `https://api.github.com/repos/${repository}/releases/latest`;
|
||||
else
|
||||
url = `https://api.github.com/repos/${repository}/releases/tags/bun-v${version}`;
|
||||
url = `https://api.github.com/repos/${repository}/releases/tags/${version.includes('canary') ? version : `bun-v${version}`}`;
|
||||
const release = await (await fetch(url, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.5",
|
||||
"name": "setup-bun",
|
||||
"main": "dist/index.js",
|
||||
"type": "module",
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { getInput } from '@actions/core';
|
||||
import fetch from 'node-fetch';
|
||||
|
||||
export interface Asset {
|
||||
@ -19,7 +18,7 @@ export default async(version: string, token: string, miscTestBuilds: boolean): P
|
||||
const repository = miscTestBuilds ? 'oven-sh/misc-test-builds' : 'oven-sh/bun'
|
||||
let url;
|
||||
if (version === 'latest' || miscTestBuilds) url = `https://api.github.com/repos/${repository}/releases/latest`;
|
||||
else url = `https://api.github.com/repos/${repository}/releases/tags/bun-v${version}`;
|
||||
else url = `https://api.github.com/repos/${repository}/releases/tags/${version.includes('canary') ? version : `bun-v${version}`}`;
|
||||
|
||||
const release: any = await (await fetch(url, {
|
||||
headers: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user