Build and deploy the website

This commit is contained in:
Tim Schaub
2022-08-14 17:40:33 -06:00
parent adc9a5318e
commit 9d73a9185f
6 changed files with 621 additions and 33 deletions
+27
View File
@@ -0,0 +1,27 @@
import semver from 'semver';
import {Octokit} from '@octokit/rest';
async function main() {
const client = new Octokit();
let latest = '0.0.0';
await client.paginate(
client.rest.repos.listReleases,
{
owner: 'openlayers',
repo: 'openlayers',
},
(response) => {
for (const release of response.data) {
const version = semver.valid(release.name);
if (version && semver.gt(version, latest)) {
latest = version;
}
}
}
);
process.stdout.write(`v${latest}\n`);
}
main();