ci: switch to woodpecker and gitea
This commit is contained in:
parent
0607a7de20
commit
6f392e5216
14 changed files with 350 additions and 279 deletions
|
@ -7,15 +7,20 @@ import semver from "semver";
|
|||
import yargs from "yargs";
|
||||
import { hideBin } from "yargs/helpers";
|
||||
|
||||
const repository = "dungeonslayers/ds4";
|
||||
const gitlabURL = "https://git.f3l.de";
|
||||
const packageType = "system";
|
||||
const repositoryOwner = process.env.CI_REPO_OWNER;
|
||||
const repositoryName = process.env.CI_REPO_NAME;
|
||||
const repositoryURL = process.env.CI_REPO_LINK;
|
||||
const forgeURL = process.env.CI_FORGE_URL;
|
||||
|
||||
const getLicenseURL = (version) => `${gitlabURL}/${repository}/-/raw/${version}/LICENSE.md`;
|
||||
const getReadmeURL = (version) => `${gitlabURL}/${repository}/-/raw/${version}/README.md`;
|
||||
const getChangelogURL = (version) => `${gitlabURL}/${repository}/-/releases/v${version}`;
|
||||
const getDownloadURL = (version) => `${gitlabURL}/${repository}/-/releases/v${version}/downloads/system.zip`;
|
||||
const manifestURL = `${forgeURL}/api/packages/${repositoryOwner}/generic/${repositoryName}/latest/${packageType}.json`;
|
||||
const getDownloadURL = (version) => `${repositoryURL}/releases/download/${version}/${repositoryName}.zip`;
|
||||
const bugsURL = `${repositoryURL}/issues`;
|
||||
const getChangelogURL = (version) => `${repositoryURL}/releases/tag/${version}`;
|
||||
const getReadmeURL = (version) => `${repositoryURL}/raw/tag/${version}/README.md`;
|
||||
const getLicenseURL = (version) => `${repositoryURL}/raw/tag/${version}/LICENSE.md`;
|
||||
|
||||
const manifestPath = "./system.json";
|
||||
const manifestPath = `${packageType}.json`;
|
||||
|
||||
/**
|
||||
* Get the contents of the manifest file as object.
|
||||
|
@ -67,11 +72,14 @@ function bumpVersion(release) {
|
|||
console.log(`Bumping version number to '${targetVersion}'`);
|
||||
packageJson.version = targetVersion;
|
||||
fs.writeJSONSync("package.json", packageJson, { spaces: 4 });
|
||||
manifest.license = getLicenseURL(targetVersion);
|
||||
manifest.readme = getReadmeURL(targetVersion);
|
||||
manifest.changelog = getChangelogURL(targetVersion);
|
||||
manifest.version = targetVersion;
|
||||
manifest.url = repositoryURL;
|
||||
manifest.manifest = manifestURL;
|
||||
manifest.download = getDownloadURL(targetVersion);
|
||||
manifest.bugs = bugsURL;
|
||||
manifest.changelog = getChangelogURL(targetVersion);
|
||||
manifest.readme = getReadmeURL(targetVersion);
|
||||
manifest.license = getLicenseURL(targetVersion);
|
||||
fs.writeJSONSync(manifestPath, manifest, { spaces: 4 });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue