diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 68f58973..a204703d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -69,8 +69,11 @@ on: description: Publish Python artifacts to https://test.pypi.org default: false required: false - # Releasability checks are not fully implemented for Python projects - # This flag allows to skip releasability checks and allow releasing the artifacts. It is ignored for non-python projects + publishToNpmJS: + type: boolean + description: Publish Javascript artifacts to https://www.npmjs.com + default: false + required: false skipPythonReleasabilityChecks: type: boolean description: Skip releasability checks for Python projects @@ -294,6 +297,16 @@ jobs: artifactoryRoleSuffix: ${{ inputs.artifactoryRoleSuffix }} slackChannel: ${{ inputs.slackChannel }} + npmjs: + name: NpmJS + needs: release + if: ${{ inputs.publishToNpmJS && inputs.dryRun != true }} + uses: ./.github/workflows/npmjs.yaml + with: + vaultAddr: ${{ inputs.vaultAddr }} + artifactoryRoleSuffix: ${{ inputs.artifactoryRoleSuffix }} + slackChannel: ${{ inputs.slackChannel }} + datadog: name: Push results to datadog runs-on: ubuntu-latest @@ -303,6 +316,7 @@ jobs: - javadocPublication - testPypi - pypi + - npmjs if: ${{ always() && inputs.pushToDatadog && inputs.dryRun != true }} steps: # Clone gh-action_release repository to run actions locally @@ -342,7 +356,8 @@ jobs: javadoc_published: ${{ needs.javadocPublication.result }} testpypi_published: ${{ needs.testPypi.result }} pypi_published: ${{ needs.pypi.result }} - status: ${{ job.status == 'success' && needs.release.result == 'success' && needs.mavenCentral.result != 'failure' && needs.javadocPublication.result != 'failure' && needs.testPypi.result != 'failure' && needs.pypi.result != 'failure' }} + npmjs_published: ${{ needs.npmjs.result }} + status: ${{ job.status == 'success' && needs.release.result == 'success' && needs.mavenCentral.result != 'failure' && needs.javadocPublication.result != 'failure' && needs.testPypi.result != 'failure' && needs.pypi.result != 'failure' && needs.npmjs.result != 'failure' }} repo: ${{ github.repository }} run_id: ${{ github.run_id }} is_dummy_project: ${{ inputs.isDummyProject }} diff --git a/README.md b/README.md index be85dc8b..bea9a372 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Available options: - `mavenCentralSyncExclusions` (default: *none*): exclude some artifacts from synchronization - `publishToPyPI` (default: *false*): Publish pypi artifacts to https://pypi.org/, **for OSS projects only** - `publishToTestPyPI` (default: *false*): Publish pypi artifacts to https://test.pypi.org/, **for OSS projects only** +- `publishToNpmJS` (default: *false*): Publish npm artifacts to https://www.npmjs.com/, **for OSS projects only** - `skipPythonReleasabilityChecks` (default: *false*): Skip releasability checks **for Python projects only** - `slackChannel` (default: *build*): notification Slack channel - `artifactoryRoleSuffix` (default: *promoter*): Artifactory promoter suffix @@ -99,6 +100,13 @@ development/artifactory/token/{REPO_OWNER_NAME_DASH}-private-reader development/kv/data/pypi-test ``` +#### Additional permissions if using `publishToNpmJS` + +``` +development/artifactory/token/{REPO_OWNER_NAME_DASH}-private-reader +development/kv/data/npmjs +``` + ## Versioning ### Tags diff --git a/datadog-ingest/main.py b/datadog-ingest/main.py index e576fb58..51a52722 100644 --- a/datadog-ingest/main.py +++ b/datadog-ingest/main.py @@ -26,6 +26,7 @@ def prepare_logs(): "javadoc_published": os.environ.get('javadoc_published'), "testpypi_published": os.environ.get('testpypi_published'), "pypi_published": os.environ.get('pypi_published'), + "npm_published": os.environ.get('npm_published'), "status": os.environ.get('status'), "is_dummy_project": os.environ.get('is_dummy_project') }