Skip to content

Commit

Permalink
chore: add publish to public steps foir mixcr wf
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-ainsel committed Oct 10, 2024
1 parent 3837121 commit a5f785e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/java-gradle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,20 @@ on:
type: string
required: false
default: 'develop'

publish-script-name:
description: |
Run 'npm run <script>' instead of 'npm publish'
type: string
required: false
default: ""

publish-to-public:
description: |
Whether or not the npm package should be published as public.
type: boolean
required: false
default: false
#
# Notifications
#
Expand Down Expand Up @@ -2106,6 +2120,8 @@ jobs:
npm-auth-token: ${{ env.NPMJS_TOKEN || secrets.GITHUB_TOKEN }}
scope: ${{ inputs.node-scope }}
always-auth: ${{ inputs.node-always-auth }}
publish-script-name: ${{ inputs.publish-script-name }}
publish-to-public: ${{ inputs.publish-to-public }}
pl-bin-registry-upload-url: ${{ secrets.BIN_REGISTRY_S3_BUCKET_URL }}
gcloud-sdk-version: ${{ inputs.sign-gcloud-sdk-version }}
gcloud-kms-location: ${{ inputs.sign-gcloud-kms-location }}
Expand Down
24 changes: 20 additions & 4 deletions blocks/node/sign-and-publish/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ inputs:
#
# NodeJS Control
#
release-script-name:
publish-script-name:
description: |
Specify the name of the release script to be executed via npm.
Run 'npm run <script>' instead of 'npm publish'
required: false
default: 'release'
default: ""

publish-to-public:
description: |
Whether or not the npm package should be published as public.
required: false
default: 'false'

execution-path:
description: |
Expand Down Expand Up @@ -233,6 +239,8 @@ runs:
WORKING_DIRECTORY: ${{ inputs.execution-path }}
NODE_AUTH_TOKEN: ${{ inputs.npm-auth-token }}
PL_REGISTRY_MILABORATORIES_UPLOAD_URL: ${{ inputs.pl-bin-registry-upload-url }}
PUBLISH_SCRIPT: ${{ inputs.publish-script-name }}
PUBLISH_TO_PUBLIC: ${{ inputs.publish-to-public }}
GCP_KMS_KEY_VERSION: ${{ inputs.gcloud-kms-key-version }}
GCP_KMS_KEY_NAME: ${{ inputs.gcloud-kms-key-name }}
GCP_KMS_KEYRING: ${{ inputs.gcloud-kms-keyring }}
Expand All @@ -241,4 +249,12 @@ runs:
with:
run: |
cd "${WORKING_DIRECTORY}"
npm run ${{ inputs.release-script-name }}
if [ -z "${PUBLISH_SCRIPT}" ]; then
if [ "${PUBLISH_TO_PUBLIC}" == "true" ]; then
npm publish --access public
else
npm publish
fi
else
npm run "${PUBLISH_SCRIPT}"
fi

0 comments on commit a5f785e

Please sign in to comment.