This repository has been archived by the owner on Feb 19, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds automated testing on PR / Fix WHL push for PyPI
- Loading branch information
Showing
17 changed files
with
1,381 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ LICENSE | |
Makefile | ||
README.md | ||
VERSION | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
name: Test image functionality | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::$(cat VERSION)1$(( $RANDOM % 1000 )) | ||
|
||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile --tag jsii-publish:current | ||
|
||
- name: Build the test package | ||
run: >- | ||
docker run | ||
--workdir /workdir | ||
--volume ${PWD}/test:/workdir | ||
--env VERSION=${{ steps.get_version.outputs.VERSION }} | ||
--env BUILD_SOURCE=true | ||
--env BUILD_PACKAGES=true | ||
jsii-publish:current | ||
- name: Publish to npm | ||
run: >- | ||
docker run | ||
--workdir /workdir | ||
--volume ${PWD}/test:/workdir | ||
--env NPM_TOKEN="${{ secrets.NPM_TOKEN }}" | ||
jsii-publish:current | ||
- name: Publish to PyPI | ||
run: >- | ||
docker run | ||
--workdir /workdir | ||
--volume ${PWD}/test:/workdir | ||
--env PYPI_TOKEN="${{ secrets.PYPI_TOKEN }}" | ||
jsii-publish:current | ||
- name: Publish to NuGet | ||
run: >- | ||
docker run | ||
--workdir /workdir | ||
--volume ${PWD}/test:/workdir | ||
--env NUGET_TOKEN="${{ secrets.NUGET_TOKEN }}" | ||
jsii-publish:current | ||
- name: Publish to Maven GitHub | ||
run: >- | ||
docker run | ||
--workdir /workdir | ||
--volume ${PWD}/test:/workdir | ||
--env GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" | ||
--env GITHUB_REPOSITORY="${{ github.repository }}" | ||
jsii-publish:current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
test/dist | ||
test/node_modules | ||
test/tsconfig.json | ||
test/lib/*.js | ||
test/lib/*.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ Package building and publishing to npm, PyPI, NuGet and Maven (GitHub). | |
|
||
## Examples | ||
|
||
### Usage in a GitHub workflow | ||
### GitHub workflow | ||
|
||
```yml | ||
--- | ||
|
@@ -36,7 +36,7 @@ jobs: | |
fetch-depth: 1 | ||
|
||
- name: Publish packages | ||
uses: udondan/[email protected].2 | ||
uses: udondan/[email protected].3 | ||
with: | ||
VERSION: ${{ steps.get_version.outputs.VERSION }} | ||
BUILD_SOURCE: true | ||
|
@@ -74,39 +74,39 @@ jobs: | |
fetch-depth: 1 | ||
|
||
- name: Build source | ||
uses: udondan/[email protected].2 | ||
uses: udondan/[email protected].3 | ||
with: | ||
VERSION: ${{ steps.get_version.outputs.VERSION }} | ||
BUILD_SOURCE: true | ||
|
||
- name: Build packages | ||
uses: udondan/[email protected].2 | ||
uses: udondan/[email protected].3 | ||
with: | ||
BUILD_PACKAGES: true | ||
|
||
- name: Publish to npm | ||
uses: udondan/[email protected].2 | ||
uses: udondan/[email protected].3 | ||
with: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Publish to PyPI | ||
uses: udondan/[email protected].2 | ||
uses: udondan/[email protected].3 | ||
with: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
|
||
- name: Publish to NuGet | ||
uses: udondan/[email protected].2 | ||
uses: udondan/[email protected].3 | ||
with: | ||
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} | ||
|
||
- name: Publish to Maven GitHub | ||
uses: udondan/[email protected].2 | ||
uses: udondan/[email protected].3 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPOSITORY: ${{ github.repository }} | ||
``` | ||
### Usage for running the Docker image locally | ||
### Running the Docker image locally | ||
```bash | ||
docker run -it \ | ||
|
@@ -120,7 +120,7 @@ docker run -it \ | |
--env NUGET_TOKEN \ | ||
--env GITHUB_TOKEN \ | ||
--env GITHUB_REPOSITORY="${OWNER}/${REPOSITORY}" \ | ||
udondan/jsii-publish:0.8.2 | ||
udondan/jsii-publish:0.8.3 | ||
``` | ||
|
||
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,7 +135,7 @@ 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 }}`. | ||
- **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**. | ||
|
||
## License | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.8.2 | ||
0.8.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.