9 Commits

Author SHA1 Message Date
Hyro
27a94d6f80 chore(action): fix 2022-07-27 08:20:47 +02:00
Hyro
b0a04f5fb3 chore: bump version 2022-07-27 08:18:45 +02:00
Hyro
ddba6331f8 chore: bump version 2022-07-27 08:18:27 +02:00
Hyro
99221c1ae0 fix(action): add github.token as default 2022-07-27 08:18:12 +02:00
Hyro
13923243f4 chore(README): add github token 2022-07-26 07:29:31 +02:00
xHyroM
a9318b00d5 chore(test): update 2022-07-25 22:48:11 +02:00
xHyroM
bf40fde936 chore(test): update 2022-07-25 22:36:22 +02:00
xHyroM
92c5bc2cef chore(test): add canary 2022-07-25 22:32:15 +02:00
xHyroM
37397a08ec feat: canary support 2022-07-25 22:31:43 +02:00
6 changed files with 38 additions and 13 deletions

View File

@@ -14,7 +14,30 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
bun-version:
["latest", "0.1.3", "latest"]
["latest", "0.1.4"]
misc-test-builds:
[false]
steps:
- uses: actions/checkout@v2
- name: Setup Bun - Test Builds * ${{ matrix.misc-test-builds }}
uses: ./
with:
bun-version: ${{ matrix.bun-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
misc-test-builds: ${{ matrix.misc-test-builds }}
- name: Try bun
run: |
bun --version
test-canary:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
bun-version:
["canary"]
misc-test-builds:
[false]

View File

@@ -8,24 +8,26 @@ Set up your GitHub Actions workflow with a specific version of Bun.
### Latest stable
```yaml
- uses: xhyrom/setup-bun@v0.1.3
- uses: xhyrom/setup-bun@v0.1.6
with:
bun-version: latest
github-token: ${{ secrets.GITHUB_TOKEN }}
```
### Specific version
```yaml
- uses: xhyrom/setup-bun@v0.1.3
- uses: xhyrom/setup-bun@v0.1.6
with:
bun-version: "0.1.3"
bun-version: "0.1.5"
github-token: ${{ secrets.GITHUB_TOKEN }}
```
### Test builds
### Canary builds
```yaml
- uses: xhyrom/setup-bun@v0.1.3
- uses: xhyrom/setup-bun@v0.1.6
with:
bun-version: latest
misc-test-builds: true
bun-version: canary
github-token: ${{ secrets.GITHUB_TOKEN }}
```

View File

@@ -12,6 +12,7 @@ inputs:
default: "latest"
github-token:
description: "The github token secret can be passed in using {{ secrets.GITHUB_TOKEN }}"
default: ${{ github.token }}
misc-test-builds:
description: "Install builds from https://github.com/oven-sh/misc-test-builds (not recommended!)"
required: false
@@ -22,4 +23,4 @@ outputs:
runs:
using: "node12"
main: "dist/index.js"
main: "dist/index.js"

View File

@@ -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',

View File

@@ -1,5 +1,5 @@
{
"version": "0.1.4",
"version": "0.1.6",
"name": "setup-bun",
"main": "dist/index.js",
"type": "module",

View File

@@ -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: {