diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 3783357..72ff69d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -47,6 +47,5 @@ jobs: dry_run: true asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }} branch_name: ${{ github.event.pull_request.head.ref }} - publish_package: false tag_format: ${{ needs.get_asdf_version.outputs.tag_format }} secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01b381f..2610b2f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,6 +39,5 @@ jobs: dry_run: false asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }} branch_name: main - publish_package: false tag_format: ${{ needs.get_asdf_version.outputs.tag_format }} secrets: inherit diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 25e71ea..e9129bc 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -15,10 +15,11 @@ on: type: string required: false default: "0.18.0" - publish_package: - description: "Whether to publish a package to an npm registry" - required: true - type: boolean + publish_packages: + description: "comma separated list of package folders to publish to an npm registry" + required: false + type: string + default: "" tag_format: description: "The tag format to use for the release tags" required: false @@ -230,7 +231,7 @@ jobs: name: config_artifact - name: Cache asdf - if: ${{ inputs.publish_package }} + if: inputs.publish_packages != '' uses: actions/cache@v5 with: path: | @@ -240,7 +241,7 @@ jobs: ${{ runner.os }}-asdf- - name: Install asdf dependencies in .tool-versions - if: ${{ inputs.publish_package }} + if: inputs.publish_packages != '' uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47 with: asdf_version: ${{ inputs.asdfVersion }} @@ -248,7 +249,7 @@ jobs: PYTHON_CONFIGURE_OPTS: --enable-shared - name: Install Dependencies and Build Package - if: ${{ inputs.publish_package }} + if: inputs.publish_packages != '' run: | make install make build @@ -314,7 +315,7 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} BRANCH_NAME: ${{ inputs.branch_name }} - PUBLISH_PACKAGE: ${{ inputs.publish_package }} + PUBLISH_PACKAGES: ${{ inputs.publish_packages }} TAG_FORMAT: ${{ inputs.tag_format }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} MAIN_BRANCH: ${{ inputs.main_branch }} @@ -325,7 +326,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - PUBLISH_PACKAGE: ${{ inputs.publish_package }} + PUBLISH_PACKAGES: ${{ inputs.publish_packages }} TAG_FORMAT: ${{ inputs.tag_format }} MAIN_BRANCH: ${{ inputs.main_branch }} EXTRA_ASSET: ${{ inputs.extra_artifact_name }} diff --git a/release.config.cjs b/release.config.cjs index 01b1935..9c6c739 100644 --- a/release.config.cjs +++ b/release.config.cjs @@ -2,7 +2,7 @@ const { readFileSync } = require("fs") const commitTemplate = readFileSync("./releaseNotesTemplates/commit.hbs").toString() -const publish_package = process.env.PUBLISH_PACKAGE === "true" +const publish_packages = process.env.PUBLISH_PACKAGES?.split(",").map(s => s.trim()).filter(s => s.length > 0) || [] const mainBranch = process.env.MAIN_BRANCH || "main" module.exports = { @@ -67,7 +67,12 @@ module.exports = { changelogFile: "CHANGELOG.md" } ], - ...(publish_package ? ["@semantic-release/npm"] : []), + ...publish_packages.map(subpackage => [ + "@semantic-release/npm", + { + pkgRoot: subpackage + } + ]), [ "@semantic-release/github", { diff --git a/sonar-project.properties b/sonar-project.properties index c2aa41b..f6b852a 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,3 +1,6 @@ sonar.organization=nhsdigital sonar.projectKey=NHSDigital_eps-common-workflows -sonar.host.url=https://sonarcloud.io \ No newline at end of file +sonar.host.url=https://sonarcloud.io + +sonar.coverage.exclusions=\ + release.config.cjs \ No newline at end of file