From ec3236becce862d39f89f673bad80a7d9d506550 Mon Sep 17 00:00:00 2001 From: Mario Buikhuizen Date: Fri, 23 Feb 2024 16:20:15 +0100 Subject: [PATCH] ci: fix npm release --- .github/workflows/test.yml | 49 +++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2cb3c03e..7634c608 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install "reacton[generate]" ipyvue + pip install "reacton[generate]" ipyvue "jupyterlab~=3.0" - name: build wheel run: python -m build @@ -44,6 +44,10 @@ jobs: python -m ipyvuetify.components diff ipyvuetify/components.py ipyvuetify/components-previous.py + - name: Package js + run: (cd js && npm pack) + - name: show files + run: find . - name: Upload build artifacts uses: actions/upload-artifact@v3 with: @@ -142,3 +146,46 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} PRE_RELEASE: ${{ github.event.release.prerelease }} + + check_release: + # if: startsWith(github.event.ref, 'refs/tags/v') + needs: [build] + runs-on: ubuntu-20.04 + steps: + - uses: actions/download-artifact@v3 + with: + name: ipyvuetify-dist-${{ github.run_number }} + + - name: Show files + run: find . + - name: Install node + uses: actions/setup-node@v1 + with: + node-version: "14.x" + registry-url: "https://registry.npmjs.org" + + # - name: Install Python + # uses: actions/setup-python@v2 + # with: + # python-version: 3.8 + + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip + # pip install twine wheel jupyter-packaging jupyterlab + + # - name: Publish the Python package + # env: + # TWINE_USERNAME: __token__ + # TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + # run: twine upload --skip-existing dist/* + + - name: Publish the NPM package + run: | + cd js + echo $PRE_RELEASE + if [[ $PRE_RELEASE == "true" ]]; then export TAG="next"; else export TAG="latest"; fi + npm publish --dry-run --access public *.tgz + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + PRE_RELEASE: ${{ github.event.release.prerelease }}