diff --git a/README.md b/README.md index 916f69f..890735f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ jobs: fetch-depth: 1 - name: Publish packages - uses: udondan/jsii-publish@v0.8.3 + uses: udondan/jsii-publish@v0.10.0 with: VERSION: ${{ steps.get_version.outputs.VERSION }} BUILD_SOURCE: true @@ -74,33 +74,33 @@ jobs: fetch-depth: 1 - name: Build source - uses: udondan/jsii-publish@v0.8.3 + uses: udondan/jsii-publish@v0.10.0 with: VERSION: ${{ steps.get_version.outputs.VERSION }} BUILD_SOURCE: true - name: Build packages - uses: udondan/jsii-publish@v0.8.3 + uses: udondan/jsii-publish@v0.10.0 with: BUILD_PACKAGES: true - name: Publish to npm - uses: udondan/jsii-publish@v0.8.3 + uses: udondan/jsii-publish@v0.10.0 with: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish to PyPI - uses: udondan/jsii-publish@v0.8.3 + uses: udondan/jsii-publish@v0.10.0 with: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - name: Publish to NuGet - uses: udondan/jsii-publish@v0.8.3 + uses: udondan/jsii-publish@v0.10.0 with: NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} - name: Publish to Maven GitHub - uses: udondan/jsii-publish@v0.8.3 + uses: udondan/jsii-publish@v0.10.0 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REPOSITORY: ${{ github.repository }} @@ -120,7 +120,7 @@ docker run -it \ --env NUGET_TOKEN \ --env GITHUB_TOKEN \ --env GITHUB_REPOSITORY="${OWNER}/${REPOSITORY}" \ - udondan/jsii-publish:0.8.3 + udondan/jsii-publish:0.10.0 ``` The package code can be mounted to any location in the container. Just make sure you set the workdir to the same value. In the example above I use `/workdir`. @@ -135,8 +135,11 @@ Parameters passed per env: - **NUGET_TOKEN**: Your publish token for NuGet. If passed, package will be published to NuGet - **GITHUB_TOKEN**: The token to interact with GitHub. If passed, the Maven package will be published to GitHub packages. If you run the GitHub action, the token will be automatically be generated byu GitHub and is available as `${{ GITHUB_TOKEN }}`. If you run the Docker image yourself, you need to pass in a [personal access token](https://github.com/settings/tokens) with `read:packages` and `write:packages` capabilities. -- **GITHUB_REPOSITORY**: The url slug of your repository, which is `${OWNER}/${REPOSITORY}`. In a github action you can just pass `${{ github.repository }}`. -- **DEBUG**: If `true`, debug mode is enabled. **Might leak secrets in output**. +- **GITHUB_REPOSITORY**: The url slug of your repository, which is `${OWNER}/${REPOSITORY}`. In a github action you can just pass `${{ github.repository }}` +- **DEBUG**: If `true`, debug mode is enabled. **Might leak secrets in output** +- **NPM_OPTIONS**: Command options to append to the `npm publish` command +- **PYPI_OPTIONS**: Command options to append to the `twine upload` command +- **NUGET_OPTIONS**: Command options to append to the `dotnet nuget push` command ## License diff --git a/VERSION b/VERSION index ac39a10..78bc1ab 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.0 +0.10.0 diff --git a/action.yml b/action.yml index 30cfb19..83c2519 100644 --- a/action.yml +++ b/action.yml @@ -7,7 +7,7 @@ branding: color: orange runs: using: docker - image: docker://udondan/jsii-publish:0.9.0 + image: docker://udondan/jsii-publish:0.10.0 inputs: BUILD_SOURCE: description: Indicates if the source should be build (tsc) @@ -31,8 +31,17 @@ inputs: description: Your publish token for GitHub. If passed, Maven package will be published to Github required: false GITHUB_REPOSITORY: - description: GitHub repository path. OWNER/REPO, e.g. "udondan/jsii-publish". You can just pass in "{{ github.repository }}" + description: GitHub repository path. OWNER/REPO, e.g. `udondan/jsii-publish`. You can just pass in `{{ github.repository }}` required: false DEBUG: description: Enables debug mode default: false + NPM_OPTIONS: + description: Command options to append to the `npm publish` command + required: false + PYPI_OPTIONS: + description: Command options to append to the `twine upload` command + required: false + NUGET_OPTIONS: + description: Command options to append to the `dotnet nuget push` command + required: false diff --git a/scripts/entrypoint b/scripts/entrypoint index 3030d70..2bce895 100644 --- a/scripts/entrypoint +++ b/scripts/entrypoint @@ -75,6 +75,9 @@ var PYPI_TOKEN var NUGET_TOKEN var GITHUB_TOKEN var GITHUB_REPOSITORY +var NPM_OPTIONS +var PYPI_OPTIONS +var NUGET_OPTIONS if [[ "${DEBUG}" = true ]]; then set -x diff --git a/scripts/publish/npm b/scripts/publish/npm index 3ddfbf1..587cce9 100644 --- a/scripts/publish/npm +++ b/scripts/publish/npm @@ -11,6 +11,11 @@ publish_to_npm() { if [[ "${DEBUG}" = true ]]; then cmd+=(--verbose) fi + + if [ -n "${NPM_OPTIONS}" ]; then + cmd+=("${NPM_OPTIONS}") + fi + cmd+=("$1") eval "${cmd[@]}" diff --git a/scripts/publish/nuget b/scripts/publish/nuget index f05aea3..8a22c42 100644 --- a/scripts/publish/nuget +++ b/scripts/publish/nuget @@ -9,6 +9,11 @@ publish_to_nuget() { if [[ "${DEBUG}" = true ]]; then cmd+=(--verbosity Debug) fi + + if [ -n "${NUGET_OPTIONS}" ]; then + cmd+=("${NUGET_OPTIONS}") + fi + cmd+=(push "$1" -k "${NUGET_TOKEN}" -s https://api.nuget.org/v3/index.json --skip-duplicate) eval "${cmd[@]}" diff --git a/scripts/publish/pypi b/scripts/publish/pypi index 19d7060..1a5e1c2 100644 --- a/scripts/publish/pypi +++ b/scripts/publish/pypi @@ -15,6 +15,11 @@ EOF if [[ "${DEBUG}" = true ]]; then cmd+=(--verbose) fi + + if [ -n "${PYPI_OPTIONS}" ]; then + cmd+=("${PYPI_OPTIONS}") + fi + cmd+=("$1/*") eval "${cmd[@]}"