Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

Commit

Permalink
Adds option to wipe the dist dir (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
udondan authored Jul 21, 2020
1 parent e4630a5 commit be404e8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fetch-depth: 1

- name: Publish packages
uses: udondan/jsii-publish@v0.10.0
uses: udondan/jsii-publish@v0.11.0
with:
VERSION: ${{ steps.get_version.outputs.VERSION }}
BUILD_SOURCE: true
Expand Down Expand Up @@ -74,33 +74,33 @@ jobs:
fetch-depth: 1

- name: Build source
uses: udondan/jsii-publish@v0.10.0
uses: udondan/jsii-publish@v0.11.0
with:
VERSION: ${{ steps.get_version.outputs.VERSION }}
BUILD_SOURCE: true

- name: Build packages
uses: udondan/jsii-publish@v0.10.0
uses: udondan/jsii-publish@v0.11.0
with:
BUILD_PACKAGES: true

- name: Publish to npm
uses: udondan/jsii-publish@v0.10.0
uses: udondan/jsii-publish@v0.11.0
with:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to PyPI
uses: udondan/jsii-publish@v0.10.0
uses: udondan/jsii-publish@v0.11.0
with:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

- name: Publish to NuGet
uses: udondan/jsii-publish@v0.10.0
uses: udondan/jsii-publish@v0.11.0
with:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}

- name: Publish to Maven GitHub
uses: udondan/jsii-publish@v0.10.0
uses: udondan/jsii-publish@v0.11.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
Expand All @@ -120,7 +120,7 @@ docker run -it \
--env NUGET_TOKEN \
--env GITHUB_TOKEN \
--env GITHUB_REPOSITORY="${OWNER}/${REPOSITORY}" \
udondan/jsii-publish:0.10.0
udondan/jsii-publish:0.11.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`.
Expand All @@ -130,6 +130,7 @@ Parameters passed per env:
- **VERSION**: If set, the version in `package.json` will be updated with this value
- **BUILD_SOURCE**: If `true`, the source will be compiled from TS to JS
- **BUILD_PACKAGES**: If `true`, all configured JSII packages will be built
- **CLEANUP**: If `true`, deletes the dist directory after publishing
- **NPM_TOKEN**: Your publish token for npm. If passed, package will be published to npm
- **PYPI_TOKEN**: Your publish token for PyPI. If passed, package will be published to PyPI
- **NUGET_TOKEN**: Your publish token for NuGet. If passed, package will be published to NuGet
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.0
0.11.0
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ branding:
color: orange
runs:
using: docker
image: docker://udondan/jsii-publish:0.10.0
image: docker://udondan/jsii-publish:0.11.0
inputs:
BUILD_SOURCE:
description: Indicates if the source should be build (tsc)
default: false
BUILD_PACKAGES:
description: Indicates if the packages should be build (jsii)
default: false
CLEANUP:
description: Deletes the dist directory after publishing
required: false
VERSION:
description: If set, the version in `package.json` will be updated with this value
required: false
Expand Down
6 changes: 6 additions & 0 deletions scripts/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ var DEBUG true
var VERSION
var BUILD_SOURCE true
var BUILD_PACKAGES true
var CLEANUP true
var NPM_TOKEN
var PYPI_TOKEN
var NUGET_TOKEN
Expand Down Expand Up @@ -118,4 +119,9 @@ fi
# Publish to Maven if token is present
[ -n "${GITHUB_TOKEN}" ] && publish_to_maven dist/java

if [[ "${CLEANUP}" = true ]]; then
print "Deleting dist directory..."
rm -rf dist
fi

exit 0

0 comments on commit be404e8

Please sign in to comment.