Compare commits

..

19 Commits

Author SHA1 Message Date
AJ ONeal
9fa3ac5796 wip: reorg some vars 2023-12-31 02:29:04 -07:00
AJ ONeal
a249238af3 WIP: chore: things 2023-12-31 02:28:43 -07:00
AJ ONeal
51ede48ece feat(webi): show latest project release version on error 2023-12-31 01:53:50 -07:00
AJ ONeal
1fa5746ccd ref(webi): show supported OSes, etc with space rather than comma 2023-12-31 01:53:50 -07:00
AJ ONeal
27959ca3ca fix(installer): accept 'ANYOS' if no explicit OS matches 2023-12-31 01:53:50 -07:00
AJ ONeal
5909757a5b feat(installer): replace getReleases with new builds classifier 2023-12-31 01:53:50 -07:00
AJ ONeal
e5fb31a5a2 fix(webi): remove bogus ./webi/releases.js 2023-12-31 01:53:50 -07:00
AJ ONeal
b620c3de0d ref(classify): parallelize release downloads to fetch *much* faster 2023-12-31 01:53:49 -07:00
AJ ONeal
ef8828bbf4 feat: add builds classifier, and lint all builds 2023-12-31 01:53:49 -07:00
AJ ONeal
df0284f1b5 chore(ci): add git submodule 2023-12-31 01:53:49 -07:00
AJ ONeal
65c365c24a feat: add build-classifier submodule 2023-12-30 23:38:26 -07:00
AJ ONeal
e9f46c355e chore: add package.json.scripts.bump 2023-12-30 23:38:26 -07:00
AJ ONeal
7bb8040404 fix(ollama-darwin): filter out .app, manually set arch for universal 2023-12-28 02:04:26 -07:00
AJ ONeal
3ae143e48b fix(goreleaser): handle extraneous build term '1' 2023-12-28 02:04:26 -07:00
AJ ONeal
2cd242c945 fix(watchexec): remove 'cli-' prefix from literal version 2023-12-28 02:04:26 -07:00
AJ ONeal
5b32ecdf08 ref(shellcheck): remove superfluous target matching 2023-12-28 02:04:26 -07:00
AJ ONeal
6b25145795 fix(zoxide): remove incorrect arch detection 2023-12-28 02:04:26 -07:00
AJ ONeal
9a3cfbb573 fix(zig): filter out legacy armv6kz (RPi 1) one-off 2023-12-17 03:20:48 -07:00
AJ ONeal
50069182eb fix(pwsh): arch = 'musl' should be libc = 'musl' 2023-12-17 03:20:24 -07:00
9 changed files with 41 additions and 87 deletions

View File

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

View File

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

View File

@@ -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],
];

View File

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

View File

@@ -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('.')) {

View File

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

View File

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

View File

@@ -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: '',
};
};