Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27a94d6f80 | ||
|
|
b0a04f5fb3 | ||
|
|
ddba6331f8 | ||
|
|
99221c1ae0 | ||
|
|
13923243f4 | ||
|
|
a9318b00d5 | ||
|
|
bf40fde936 | ||
|
|
92c5bc2cef | ||
|
|
37397a08ec | ||
|
|
a0f9c413e5 | ||
|
|
d744239ce1 | ||
|
|
bfac95679f | ||
|
|
640630d09e | ||
|
|
70b6cfe9d1 | ||
|
|
933334b350 |
29
.github/workflows/test.yml
vendored
29
.github/workflows/test.yml
vendored
@@ -14,15 +14,37 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
bun-version:
|
bun-version:
|
||||||
["latest", "0.1.3", "latest"]
|
["latest", "0.1.4"]
|
||||||
misc-test-builds:
|
misc-test-builds:
|
||||||
[false, true]
|
[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]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setup Bun - Test Builds * ${{ matrix.misc-test-builds }}
|
- name: Setup Bun - Test Builds * ${{ matrix.misc-test-builds }}
|
||||||
if: matrix.os != 'macos-latest' && matrix.misc-test-builds != true
|
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
bun-version: ${{ matrix.bun-version }}
|
bun-version: ${{ matrix.bun-version }}
|
||||||
@@ -30,6 +52,5 @@ jobs:
|
|||||||
misc-test-builds: ${{ matrix.misc-test-builds }}
|
misc-test-builds: ${{ matrix.misc-test-builds }}
|
||||||
|
|
||||||
- name: Try bun
|
- name: Try bun
|
||||||
if: matrix.os != 'macos-latest' && matrix.misc-test-builds != true
|
|
||||||
run: |
|
run: |
|
||||||
bun --version
|
bun --version
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -8,24 +8,26 @@ Set up your GitHub Actions workflow with a specific version of Bun.
|
|||||||
### Latest stable
|
### Latest stable
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: xhyrom/setup-bun@v0.1.3
|
- uses: xhyrom/setup-bun@v0.1.6
|
||||||
with:
|
with:
|
||||||
bun-version: latest
|
bun-version: latest
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Specific version
|
### Specific version
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: xhyrom/setup-bun@v0.1.3
|
- uses: xhyrom/setup-bun@v0.1.6
|
||||||
with:
|
with:
|
||||||
bun-version: "0.1.3"
|
bun-version: "0.1.5"
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Test builds
|
### Canary builds
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: xhyrom/setup-bun@v0.1.3
|
- uses: xhyrom/setup-bun@v0.1.6
|
||||||
with:
|
with:
|
||||||
bun-version: latest
|
bun-version: canary
|
||||||
misc-test-builds: true
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ inputs:
|
|||||||
default: "latest"
|
default: "latest"
|
||||||
github-token:
|
github-token:
|
||||||
description: "The github token secret can be passed in using {{ secrets.GITHUB_TOKEN }}"
|
description: "The github token secret can be passed in using {{ secrets.GITHUB_TOKEN }}"
|
||||||
|
default: ${{ github.token }}
|
||||||
misc-test-builds:
|
misc-test-builds:
|
||||||
description: "Install builds from https://github.com/oven-sh/misc-test-builds (not recommended!)"
|
description: "Install builds from https://github.com/oven-sh/misc-test-builds (not recommended!)"
|
||||||
required: false
|
required: false
|
||||||
@@ -22,4 +23,4 @@ outputs:
|
|||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "node12"
|
using: "node12"
|
||||||
main: "dist/index.js"
|
main: "dist/index.js"
|
||||||
|
|||||||
4
dist/utils/getGithubRelease.js
vendored
4
dist/utils/getGithubRelease.js
vendored
@@ -5,12 +5,12 @@ export default async (version, token, miscTestBuilds) => {
|
|||||||
if (version === 'latest' || miscTestBuilds)
|
if (version === 'latest' || miscTestBuilds)
|
||||||
url = `https://api.github.com/repos/${repository}/releases/latest`;
|
url = `https://api.github.com/repos/${repository}/releases/latest`;
|
||||||
else
|
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, {
|
const release = await (await fetch(url, {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'User-Agent': 'setup-bun-github-action',
|
'User-Agent': 'setup-bun-github-action',
|
||||||
'Authorization': token
|
'Authorization': `token ${token}`
|
||||||
}
|
}
|
||||||
})).json();
|
})).json();
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "0.1.3",
|
"version": "0.1.6",
|
||||||
"name": "setup-bun",
|
"name": "setup-bun",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { getInput } from '@actions/core';
|
|
||||||
import fetch from 'node-fetch';
|
import fetch from 'node-fetch';
|
||||||
|
|
||||||
export interface Asset {
|
export interface Asset {
|
||||||
@@ -19,13 +18,13 @@ export default async(version: string, token: string, miscTestBuilds: boolean): P
|
|||||||
const repository = miscTestBuilds ? 'oven-sh/misc-test-builds' : 'oven-sh/bun'
|
const repository = miscTestBuilds ? 'oven-sh/misc-test-builds' : 'oven-sh/bun'
|
||||||
let url;
|
let url;
|
||||||
if (version === 'latest' || miscTestBuilds) url = `https://api.github.com/repos/${repository}/releases/latest`;
|
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, {
|
const release: any = await (await fetch(url, {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'User-Agent': 'setup-bun-github-action',
|
'User-Agent': 'setup-bun-github-action',
|
||||||
'Authorization': token
|
'Authorization': `token ${token}`
|
||||||
}
|
}
|
||||||
})).json();
|
})).json();
|
||||||
|
|
||||||
@@ -33,4 +32,4 @@ export default async(version: string, token: string, miscTestBuilds: boolean): P
|
|||||||
...release,
|
...release,
|
||||||
version: miscTestBuilds ? `timestamp-v${new Date(release.name).getTime().toString()}` : release.tag_name.replace('bun-v', '')
|
version: miscTestBuilds ? `timestamp-v${new Date(release.name).getTime().toString()}` : release.tag_name.replace('bun-v', '')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user