From 0df7999641f287f51aaffe6659493988fa766ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sun, 17 Mar 2024 17:30:56 +0100 Subject: [PATCH] Update npm publish --- .github/workflows/build.yaml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ce82df38655..a2692a57278 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,7 +42,7 @@ jobs: name: Build Conda Package runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: "100" - name: Fetch unshallow @@ -105,7 +105,7 @@ jobs: fetch-depth: "100" - name: Fetch unshallow run: git fetch --prune --tags --unshallow -f - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} - uses: actions/setup-node@v4 @@ -128,7 +128,7 @@ jobs: runs-on: "ubuntu-latest" needs: [pip_build] steps: - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} - uses: actions/download-artifact@v4 @@ -161,10 +161,10 @@ jobs: name: Build NPM Package runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: "100" - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} - uses: actions/setup-node@v4 @@ -180,9 +180,11 @@ jobs: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_API_TOKEN }}" > $HOME/.npmrc npm whoami npm -v - - name: npm build + - name: package install run: | python -m pip install -ve . + - name: npm build + run: | cd ./panel TARBALL=$(npm pack .) echo "TARBALL=$TARBALL" >> $GITHUB_ENV @@ -207,20 +209,23 @@ jobs: - uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} - - name: Set name + - name: Set environment variables run: | - TARBALL=$(ls *.tgz) - echo $TARBALL - echo "TARBALL=$TARBALL" >> $GITHUB_ENV + echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + echo "TARBALL=$(ls *.tgz)" >> $GITHUB_ENV - name: npm dev deploy - if: (github.event_name == 'push' && (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc'))) + if: contains(env.TAG, 'a') || contains(env.TAG, 'b') || contains(env.TAG, 'rc') run: | # npm publish --tag dev $TARBALL + echo $TARBALL + echo $TAG ls - name: npm main deploy - if: (github.event_name == 'push' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc'))) + if: (!(contains(env.TAG, 'a') || contains(env.TAG, 'b') || contains(env.TAG, 'rc'))) run: | # npm publish --tag latest $TARBALL + echo $TARBALL + echo $TAG ls # cdn: @@ -238,7 +243,7 @@ jobs: # - uses: actions/checkout@v3 # with: # fetch-depth: "100" - # - uses: actions/setup-python@v4 + # - uses: actions/setup-python@v5 # with: # python-version: ${{ env.PYTHON_VERSION }} # - uses: actions/setup-node@v4