Skip to content

Commit

Permalink
BUILD-6482 Support new parameter to publish in npmjs
Browse files Browse the repository at this point in the history
  • Loading branch information
SamirM-BE committed Oct 3, 2024
1 parent 96e1366 commit acdc1b6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions datadog-ingest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down

0 comments on commit acdc1b6

Please sign in to comment.