pl-fe: remove more unused stuff

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-09-27 18:34:02 +02:00
parent d17805b4e9
commit 62895adb02
2 changed files with 0 additions and 63 deletions

View file

@ -1,31 +0,0 @@
import { Gitlab } from '@gitbeaker/node';
import { getChanges } from './lib/changelog';
const {
CI_COMMIT_TAG,
CI_JOB_TOKEN,
CI_PROJECT_ID,
} = process.env;
const api = new Gitlab({
host: 'https://gitlab.com',
jobToken: CI_JOB_TOKEN,
});
const main = async () => {
await api.Releases.create(CI_PROJECT_ID!, {
name: CI_COMMIT_TAG,
tag_name: CI_COMMIT_TAG,
description: '## Changelog\n\n' + getChanges(CI_COMMIT_TAG!),
assets: {
links: [{
name: 'Build',
url: `https://gitlab.com/soapbox-pub/soapbox/-/jobs/artifacts/${CI_COMMIT_TAG}/download?job=build-production`,
link_type: 'package',
}],
},
});
};
main();

View file

@ -1,32 +0,0 @@
import fs from 'fs';
import { join } from 'path';
/** Parse the changelog into an object. */
const parseChangelog = (changelog: string): Record<string, string> => {
const result: Record<string, string> = {};
let currentVersion: string;
changelog.split('\n').forEach(line => {
const match = line.match(/^## \[([\d.]+)\](?: - [\d-]+)?$/);
if (match) {
currentVersion = match[1];
} else if (currentVersion) {
result[currentVersion] = (result[currentVersion] || '') + line + '\n';
}
});
return result;
};
/** Get Markdown changes for a specific version. */
const getChanges = (version: string) => {
version = version.replace('v', '');
const content = fs.readFileSync(join(__dirname, '..', '..', 'CHANGELOG.md'), 'utf8');
const parsed = parseChangelog(content);
return (parsed[version] || '').trim();
};
export {
parseChangelog,
getChanges,
};