diff --git a/.github/scripts/CheckChangelogs.main.kts b/.github/scripts/CheckChangelogs.main.kts new file mode 100644 index 00000000..12161d9c --- /dev/null +++ b/.github/scripts/CheckChangelogs.main.kts @@ -0,0 +1,27 @@ +#!/usr/bin/env kotlin + +@file:DependsOn("com.fasterxml.jackson.module:jackson-module-kotlin:2.17.0") + +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import com.fasterxml.jackson.module.kotlin.readValue +import java.io.File + +data class Module(val name: String, val version: String) + +val modulesWithVersionsJson = args[0] + +val modules: List = jacksonObjectMapper().readValue(modulesWithVersionsJson) + +for (module in modules) { + val moduleName = module.name + val version = module.version + val pattern = Regex("## \\[$version\\]") + val changelogContent = File("./$moduleName/CHANGELOG.md").readText() + if (pattern.containsMatchIn(changelogContent)) { + println("✅ Version string $version found in CHANGELOG.md for module $moduleName") + } else { + println("⛔️ String $version not found in CHANGELOG.md for module $moduleName") + System.exit(1) + } +} + diff --git a/.github/workflows/check-changelog-files.yml b/.github/workflows/check-changelog-files.yml index ba1f53e5..64a70277 100644 --- a/.github/workflows/check-changelog-files.yml +++ b/.github/workflows/check-changelog-files.yml @@ -31,11 +31,10 @@ jobs: done jsonString="$(jq --compact-output --null-input '$ARGS.positional' --args -- "${modules_list[@]}")" - echo 'miko' echo $jsonString echo "modules=$jsonString" >> $GITHUB_OUTPUT - # - name: Check changelog files - # if: ${{ steps.get-modules-with-increased-version.outputs.modules != '' }} - # run: | - # kotlinc -script .github/scripts/CheckChangelogs.main.kts ${{ steps.get-modules-with-increased-version.outputs.modules}} \ No newline at end of file + - name: Check changelog files + if: ${{ steps.build-matrix.outputs.modules != '' }} + run: | + kotlinc -script .github/scripts/CheckChangelogs.main.kts ${{ steps.build-matrix.outputs.modules}} \ No newline at end of file diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md new file mode 100644 index 00000000..98f378bf --- /dev/null +++ b/packages/auth/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.4.0] - 2024-05-21 diff --git a/packages/auth/package.json b/packages/auth/package.json index 6d047c12..b31cc04e 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@tidal-music/auth", - "version": "1.4.1", + "version": "1.4.2", "type": "module", "files": [ "dist"