From 62895adb028e6aa956381176fe47e8d415ec18fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 27 Sep 2024 18:34:02 +0200 Subject: [PATCH] pl-fe: remove more unused stuff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/scripts/do-release.ts | 31 ------------------------ packages/pl-fe/scripts/lib/changelog.ts | 32 ------------------------- 2 files changed, 63 deletions(-) delete mode 100644 packages/pl-fe/scripts/do-release.ts delete mode 100644 packages/pl-fe/scripts/lib/changelog.ts diff --git a/packages/pl-fe/scripts/do-release.ts b/packages/pl-fe/scripts/do-release.ts deleted file mode 100644 index c3f3712553..0000000000 --- a/packages/pl-fe/scripts/do-release.ts +++ /dev/null @@ -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(); diff --git a/packages/pl-fe/scripts/lib/changelog.ts b/packages/pl-fe/scripts/lib/changelog.ts deleted file mode 100644 index bf703ccf84..0000000000 --- a/packages/pl-fe/scripts/lib/changelog.ts +++ /dev/null @@ -1,32 +0,0 @@ -import fs from 'fs'; -import { join } from 'path'; - -/** Parse the changelog into an object. */ -const parseChangelog = (changelog: string): Record => { - const result: Record = {}; - - 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, -};