Skip to content

Commit

Permalink
feat: pkg.pr.new (#313)
Browse files Browse the repository at this point in the history
* init

* Revert "init"

This reverts commit 73b1541.

* a way better version

* resolve comments

* execute-all
  • Loading branch information
Aslemammad authored Nov 25, 2024
1 parent 56cbf37 commit 171b983
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ecosystem-ci-from-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ on:
required: true
type: string
default: "vitejs/vite"
commit:
description: "vite commit sha to use"
type: string
suite:
description: "testsuite to run. runs all testsuits when `-`."
required: false
Expand Down Expand Up @@ -116,6 +119,7 @@ jobs:
pnpm tsx ecosystem-ci.ts
--branch ${{ inputs.branchName }}
--repo ${{ inputs.repo }}
--commit ${{ inputs.commit }}
${{ inputs.suite }}
- id: get-ref
if: always()
Expand Down Expand Up @@ -183,6 +187,7 @@ jobs:
pnpm tsx ecosystem-ci.ts
--branch ${{ inputs.branchName }}
--repo ${{ inputs.repo }}
--commit ${{ inputs.commit }}
${{ matrix.suite }}
- id: get-ref
if: always()
Expand Down
11 changes: 11 additions & 0 deletions ecosystem-ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ cli
.option('--commit <commit>', 'vite commit sha to use')
.option('--release <version>', 'vite release to use from npm registry')
.action(async (suites, options: CommandOptions) => {
if (options.commit) {
const url = `https://pkg.pr.new/${options.repo}/vite@${options.commit}`
//eslint-disable-next-line n/no-unsupported-features/node-builtins
const { status } = await fetch(url)
if (status === 200) {
options.release = url
delete options.commit

console.log(`continuous release available on ${url}`)
}
}
const { root, vitePath, workspace } = await setupEnvironment()
const suitesToRun = getSuitesToRun(suites, root)
let viteMajor
Expand Down

0 comments on commit 171b983

Please sign in to comment.