From a5ab74b82d542ebd92fe5d67b358632a418a2f64 Mon Sep 17 00:00:00 2001 From: Bryan Naegele Date: Sun, 4 Feb 2024 20:12:22 -0700 Subject: [PATCH] Update publish-mix-hex-release.yml --- .github/workflows/publish-mix-hex-release.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-mix-hex-release.yml b/.github/workflows/publish-mix-hex-release.yml index efa18f9..1a60f74 100644 --- a/.github/workflows/publish-mix-hex-release.yml +++ b/.github/workflows/publish-mix-hex-release.yml @@ -130,25 +130,37 @@ jobs: var srcVersionRegex = ""; var vsnLineTemplate = ""; + core.debug(`Language: ${needs.config.outputs.language`) switch(needs.config.outputs.language) { case 'elixir': srcFilePath = `${needs.config.outputs.working_directory}/mix.exs`; + core.debug(`Source file path: ${srcFilePath}`) + srcVersionRegex = /@version\s+"[^"]+"/; + core.debug(`Source version regex: ${srcVersionRegex}`) + vsnLineTemplate = `@version "${version}"`; + core.debug(`Version line template: ${vsnLineTemplate}`) + core.setOutput('srcFilePath', srcFilePath); break; case 'elixir-erlang': case 'erlang': srcFilePath = `${needs.config.outputs.working_directory}/src/${needs.config.outputs.package_name}.app.src`; + core.debug(`Source file path: ${srcFilePath}`) + srcVersionRegex = /{vsn:\s+"[^"]+"},/; - vsnLineTemplate = `{vsn: "${version}"},`; + core.debug(`Source version regex: ${srcVersionRegex}`) + + vsnLineTemplate = `{vsn, "${version}"},`; + core.debug(`Version line template: ${vsnLineTemplate}`) + core.setOutput('srcFilePath', srcFilePath); break; default: core.setFailed('Language not recognized'); } - core.info(`srcFilePath: ${srcFilePath}`) let srcFile = fs.readFileSync(srcFilePath, 'UTF8')