From bba1215d6b13cee4d837af7804c7db6dd26ae307 Mon Sep 17 00:00:00 2001 From: alvyn le Date: Wed, 16 Dec 2020 14:34:03 -0500 Subject: [PATCH] feat(v1): [#2] set up publish workflow to npm and pypi --- .github/workflows/publish.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..2ca88c4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,41 @@ +name: publish + +on: + push: + tags: + - "v*" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} + + - name: Checkout code + uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Build source + uses: udondan/jsii-publish@v0.12.0 + with: + VERSION: ${{ steps.get_version.outputs.VERSION }} + BUILD_SOURCE: true + + - name: Build packages + uses: udondan/jsii-publish@v0.12.0 + with: + BUILD_PACKAGES: true + + - name: Publish to npm + uses: udondan/jsii-publish@v0.12.0 + with: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish to PyPI + uses: udondan/jsii-publish@v0.12.0 + with: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}