Update publish-mix-hex-release.yml

This commit is contained in:
Bryan Naegele 2024-02-04 20:12:22 -07:00 committed by GitHub
parent 08a86af72a
commit a5ab74b82d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 2 deletions

View File

@ -130,25 +130,37 @@ jobs:
var srcVersionRegex = ""; var srcVersionRegex = "";
var vsnLineTemplate = ""; var vsnLineTemplate = "";
core.debug(`Language: ${needs.config.outputs.language`)
switch(needs.config.outputs.language) { switch(needs.config.outputs.language) {
case 'elixir': case 'elixir':
srcFilePath = `${needs.config.outputs.working_directory}/mix.exs`; srcFilePath = `${needs.config.outputs.working_directory}/mix.exs`;
core.debug(`Source file path: ${srcFilePath}`)
srcVersionRegex = /@version\s+"[^"]+"/; srcVersionRegex = /@version\s+"[^"]+"/;
core.debug(`Source version regex: ${srcVersionRegex}`)
vsnLineTemplate = `@version "${version}"`; vsnLineTemplate = `@version "${version}"`;
core.debug(`Version line template: ${vsnLineTemplate}`)
core.setOutput('srcFilePath', srcFilePath); core.setOutput('srcFilePath', srcFilePath);
break; break;
case 'elixir-erlang': case 'elixir-erlang':
case 'erlang': case 'erlang':
srcFilePath = `${needs.config.outputs.working_directory}/src/${needs.config.outputs.package_name}.app.src`; srcFilePath = `${needs.config.outputs.working_directory}/src/${needs.config.outputs.package_name}.app.src`;
core.debug(`Source file path: ${srcFilePath}`)
srcVersionRegex = /{vsn:\s+"[^"]+"},/; 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); core.setOutput('srcFilePath', srcFilePath);
break; break;
default: default:
core.setFailed('Language not recognized'); core.setFailed('Language not recognized');
} }
core.info(`srcFilePath: ${srcFilePath}`) core.info(`srcFilePath: ${srcFilePath}`)
let srcFile = fs.readFileSync(srcFilePath, 'UTF8') let srcFile = fs.readFileSync(srcFilePath, 'UTF8')