10 Commits

Author SHA1 Message Date
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
xHyroM
a0f9c413e5 chore(workflows): update test 2022-07-16 18:53:20 +02:00
xHyroM
d744239ce1 chore(workflows): update test 2022-07-16 18:52:25 +02:00
xHyroM
bfac95679f chore(workflows): update test 2022-07-16 18:50:53 +02:00
xHyroM
640630d09e chore: bump version 2022-07-16 18:48:17 +02:00
xHyroM
70b6cfe9d1 chore: build 2022-07-16 18:47:40 +02:00
Hyro
933334b350 fix(getGithubRelease): correct token pass 2022-07-16 18:46:00 +02:00
5 changed files with 33 additions and 14 deletions

View File

@@ -14,15 +14,37 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
bun-version:
["latest", "0.1.3", "latest"]
["latest", "0.1.4"]
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:
- uses: actions/checkout@v2
- name: Setup Bun - Test Builds * ${{ matrix.misc-test-builds }}
if: matrix.os != 'macos-latest' && matrix.misc-test-builds != true
uses: ./
with:
bun-version: ${{ matrix.bun-version }}
@@ -30,6 +52,5 @@ jobs:
misc-test-builds: ${{ matrix.misc-test-builds }}
- name: Try bun
if: matrix.os != 'macos-latest' && matrix.misc-test-builds != true
run: |
bun --version

View File

@@ -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
```

View File

@@ -5,12 +5,12 @@ 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',
'User-Agent': 'setup-bun-github-action',
'Authorization': token
'Authorization': `token ${token}`
}
})).json();
return {

View File

@@ -1,5 +1,5 @@
{
"version": "0.1.3",
"version": "0.1.5",
"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,13 +18,13 @@ 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: {
'Content-Type': 'application/json',
'User-Agent': 'setup-bun-github-action',
'Authorization': token
'Authorization': `token ${token}`
}
})).json();
@@ -33,4 +32,4 @@ export default async(version: string, token: string, miscTestBuilds: boolean): P
...release,
version: miscTestBuilds ? `timestamp-v${new Date(release.name).getTime().toString()}` : release.tag_name.replace('bun-v', '')
};
}
}