mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-05-31 13:02:46 +00:00
Compare commits
19 Commits
feat-relea
...
ref-instal
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fa3ac5796 | ||
|
|
a249238af3 | ||
|
|
51ede48ece | ||
|
|
1fa5746ccd | ||
|
|
27959ca3ca | ||
|
|
5909757a5b | ||
|
|
e5fb31a5a2 | ||
|
|
b620c3de0d | ||
|
|
ef8828bbf4 | ||
|
|
df0284f1b5 | ||
|
|
65c365c24a | ||
|
|
e9f46c355e | ||
|
|
7bb8040404 | ||
|
|
3ae143e48b | ||
|
|
2cd242c945 | ||
|
|
5b32ecdf08 | ||
|
|
6b25145795 | ||
|
|
9a3cfbb573 | ||
|
|
50069182eb |
3
.github/workflows/node.js.yml
vendored
3
.github/workflows/node.js.yml
vendored
@@ -23,6 +23,9 @@ jobs:
|
||||
sh ./_scripts/install-ci-deps
|
||||
echo "${HOME}/.local/bin" >> $GITHUB_PATH
|
||||
echo "${HOME}/.local/opt/pwsh" >> $GITHUB_PATH
|
||||
- run: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
- run: shfmt --version
|
||||
- run: shellcheck -V
|
||||
- run: node --version
|
||||
|
||||
Submodule _webi/build-classifier updated: 36b91ac129...49771ecc61
@@ -490,7 +490,7 @@ BuildsCacher.create = function ({ ALL_TERMS, installers, caches }) {
|
||||
|
||||
let pattern = Triplet.toPattern(projInfo, build);
|
||||
if (!pattern) {
|
||||
let err = new Error(`no pattern generated for ${name}`);
|
||||
let err = new Error(`no pattern generated for ${projInfo.name}`);
|
||||
err.code = 'E_BUILD_NO_PATTERN';
|
||||
target = { error: err };
|
||||
bc._targetsByBuildIdCache[buildId] = target;
|
||||
|
||||
@@ -103,7 +103,6 @@ Installers.renderBash = async function (
|
||||
['PKG_ARCHES', (rel.arches || []).join(' ')],
|
||||
['PKG_LIBCS', (rel.libcs || []).join(' ')],
|
||||
['PKG_FORMATS', (rel.formats || []).join(' ')],
|
||||
['PKG_CHANNELS', (rel.channels || []).join(' ')],
|
||||
['PKG_LATEST', latest],
|
||||
];
|
||||
|
||||
|
||||
@@ -144,13 +144,6 @@ async function main() {
|
||||
let triples = [];
|
||||
let valids = Object.keys(dirs.valid);
|
||||
|
||||
let index = valids.indexOf('webi');
|
||||
if (index >= 0) {
|
||||
// TODO fix the webi faux package
|
||||
// (not sure why I even created it)
|
||||
void valids.splice(index, 1);
|
||||
}
|
||||
|
||||
if (projName) {
|
||||
if (!valids.includes(projName)) {
|
||||
throw new Error(`'${projName}' is not a valid installable project`);
|
||||
|
||||
@@ -17,16 +17,14 @@ InstallerServer.serveInstaller = async function (
|
||||
tag,
|
||||
ext,
|
||||
formats,
|
||||
libc,
|
||||
) {
|
||||
let unameAgent = ua;
|
||||
let projectName = pkg;
|
||||
let [rel, tmplParams] = await InstallerServer.helper({
|
||||
unameAgent,
|
||||
projectName,
|
||||
tag,
|
||||
unameAgent,
|
||||
formats,
|
||||
libc,
|
||||
});
|
||||
Object.assign(tmplParams, {
|
||||
baseurl,
|
||||
@@ -46,7 +44,6 @@ InstallerServer.helper = async function ({
|
||||
projectName,
|
||||
tag,
|
||||
formats,
|
||||
libc,
|
||||
}) {
|
||||
console.log(`dbg: Installer User-Agent: ${unameAgent}`);
|
||||
|
||||
@@ -74,28 +71,15 @@ InstallerServer.helper = async function ({
|
||||
|
||||
let validTypes = ['alias', 'selfhosted', 'valid'];
|
||||
if (!validTypes.includes(proj.type)) {
|
||||
throw new Error(
|
||||
`'${projectName}' doesn't have an installer: '${proj.type}': '${proj.detail}'`,
|
||||
);
|
||||
let msg = `'${projectName}' doesn't have an installer: '${proj.type}': '${proj.detail}'`;
|
||||
let err = new Error(msg);
|
||||
err.code = 'ENOENT';
|
||||
throw err;
|
||||
}
|
||||
if (proj.type === 'alias') {
|
||||
projectName = proj.detail;
|
||||
}
|
||||
|
||||
let projInfo = await Builds.getPackage({
|
||||
name: projectName,
|
||||
date: new Date(),
|
||||
});
|
||||
//console.log('projInfo', projInfo);
|
||||
|
||||
let buildTargetInfo = {
|
||||
triplets: projInfo.triplets,
|
||||
oses: projInfo.oses,
|
||||
arches: projInfo.arches,
|
||||
libcs: projInfo.libcs,
|
||||
formats: projInfo.formats,
|
||||
};
|
||||
|
||||
let tmplParams = {
|
||||
pkg: projectName,
|
||||
tag: tag,
|
||||
@@ -105,8 +89,6 @@ InstallerServer.helper = async function ({
|
||||
formats: hostFormats,
|
||||
limit: 1,
|
||||
};
|
||||
let latest = projInfo.versions[0];
|
||||
Object.assign(tmplParams, { latest });
|
||||
Object.assign(tmplParams, releaseTarget);
|
||||
console.log('tmplParams', tmplParams);
|
||||
|
||||
@@ -127,7 +109,30 @@ InstallerServer.helper = async function ({
|
||||
"Check query parameters. Should be something like '/api/releases/{package}@{version}.tab?os={macos|linux|windows|-}&arch={amd64|x86|aarch64|arm64|armv7l|-}&libc={musl|gnu|msvc|libc|static}&limit=10'",
|
||||
};
|
||||
|
||||
if (proj.type === 'selfhosted') {
|
||||
return [errPackage, tmplParams];
|
||||
}
|
||||
|
||||
let projInfo = await Builds.getPackage({
|
||||
name: projectName,
|
||||
date: new Date(),
|
||||
});
|
||||
let latest = projInfo.versions[0];
|
||||
Object.assign(tmplParams, { latest });
|
||||
//console.log('projInfo', projInfo);
|
||||
|
||||
let buildTargetInfo = {
|
||||
triplets: projInfo.triplets,
|
||||
oses: projInfo.oses,
|
||||
arches: projInfo.arches,
|
||||
libcs: projInfo.libcs,
|
||||
formats: projInfo.formats,
|
||||
};
|
||||
|
||||
let hasOs = projInfo.oses.includes(hostTarget.os);
|
||||
if (!hasOs) {
|
||||
hasOs = projInfo.oses.includes('ANYOS');
|
||||
}
|
||||
if (!hasOs) {
|
||||
let pkg1 = Object.assign(buildTargetInfo, errPackage);
|
||||
return [pkg1, tmplParams];
|
||||
@@ -147,11 +152,6 @@ InstallerServer.helper = async function ({
|
||||
return [pkg1, tmplParams];
|
||||
}
|
||||
|
||||
if (!targetRelease.packages) {
|
||||
let pkg1 = Object.assign(buildTargetInfo, errPackage);
|
||||
return [pkg1, tmplParams];
|
||||
}
|
||||
|
||||
let buildPkg = Builds.selectPackage(targetRelease.packages, hostFormats);
|
||||
let ext = buildPkg.ext || '.exe';
|
||||
if (ext.startsWith('.')) {
|
||||
|
||||
@@ -82,11 +82,10 @@ Releases.get(path.join(process.cwd(), pkgdir)).then(async function (all) {
|
||||
var formats = ['exe', 'xz', 'tar', 'zip', 'git'];
|
||||
|
||||
let [rel, opts] = await ServeInstaller.helper({
|
||||
ua: `${nodeOs}/${nodeOsRelease} ${nodeArch}/unknown ${nodeLibc}`,
|
||||
pkg: pkgname,
|
||||
projectName: pkgname,
|
||||
tag: pkgtag || '',
|
||||
unameAgent: `${nodeOs}/${nodeOsRelease} ${nodeArch}/unknown ${nodeLibc}`,
|
||||
formats: formats,
|
||||
libc: nodeLibc,
|
||||
});
|
||||
Object.assign(
|
||||
{
|
||||
|
||||
@@ -5,19 +5,22 @@
|
||||
"description": "webinstall script repository",
|
||||
"main": "_webi/",
|
||||
"scripts": {
|
||||
"bump": "npm version -m \"chore(release): bump to v%s\"",
|
||||
"fmt": "npm run prettier && npm run shfmt && npm run pwsh-fmt",
|
||||
"lint": "npm run shellcheck && npm run jshint && npm run pwsh-lint",
|
||||
"lint": "npm run shellcheck && npm run jshint && npm run pwsh-lint && npm run tsc",
|
||||
"prepare": "npm run tooling-init && npm run git-hooks-init",
|
||||
"test": "node _webi/test.js ./node/",
|
||||
"----": "------------------------------------",
|
||||
"git-hooks-init": "node ./_scripts/git-hooks-init.js",
|
||||
"jshint": "npx -p jshint@2.x -- jshint -c ./.jshintrc --exclude 'node_modules/**/*' */*.js */*/*.js",
|
||||
"jshint": "npx -p jshint@2.x -- jshint -c ./.jshintrc --exclude 'node_modules/**/*' *.js */*.js",
|
||||
"prettier": "npx -p prettier@3.x -- prettier -w '**/*.{js,md,html}'",
|
||||
"pwsh-fmt": "pwsh ./_scripts/pwsh-fmt.ps1",
|
||||
"pwsh-lint": "pwsh ./_scripts/pwsh-lint.ps1",
|
||||
"shellcheck": "shellcheck -s sh -S style --exclude=SC2154,SC2034 */*.sh",
|
||||
"shfmt": "shfmt -w -i 4 -sr -ci -s ./",
|
||||
"tooling-init": "node ./_scripts/tooling-init.js"
|
||||
"tsc": "npx -p typescript@5.x -- tsc -p ./jsconfig.json",
|
||||
"tooling-init": "node ./_scripts/tooling-init.js",
|
||||
"prepublish": "npx -p jswt@1.x -- reexport"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = async function () {
|
||||
return {
|
||||
releases: [
|
||||
{
|
||||
name: 'webi.tar',
|
||||
version: '0.0.0',
|
||||
lts: false,
|
||||
channel: 'stable',
|
||||
date: '',
|
||||
os: 'linux',
|
||||
arch: 'amd64',
|
||||
ext: 'tar',
|
||||
download: '',
|
||||
},
|
||||
{
|
||||
name: 'webi.tar',
|
||||
version: '0.0.0',
|
||||
lts: false,
|
||||
channel: 'stable',
|
||||
date: '',
|
||||
os: 'macos',
|
||||
arch: 'amd64',
|
||||
ext: 'tar',
|
||||
download: '',
|
||||
},
|
||||
{
|
||||
name: 'webi.tar',
|
||||
version: '0.0.0',
|
||||
lts: false,
|
||||
channel: 'stable',
|
||||
date: '',
|
||||
os: 'windows',
|
||||
arch: 'amd64',
|
||||
ext: 'tar',
|
||||
download: '',
|
||||
},
|
||||
],
|
||||
formats: [],
|
||||
downloads: '',
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user