From 3bbd30cff09a8e9d8075eb6f6cfbb3f43d0e36d7 Mon Sep 17 00:00:00 2001 From: MoyuScript Date: Sun, 2 Aug 2020 15:49:02 +0800 Subject: [PATCH] Update ci (#2306) --- .github/workflows/ci.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5e3d05..ed79f64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: branches: [ master ] tags: - - 'test*' + - 'v*' pull_request: branches: [ master ] @@ -173,13 +173,19 @@ jobs: publish: runs-on: ubuntu-latest name: Publish - if: startsWith(github.ref, 'refs/tags/test') + if: startsWith(github.ref, 'refs/tags/v') needs: browser-test steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 12 + registry-url: 'https://npm.pkg.github.com' + - name: Download NPM package + uses: actions/download-artifact@v2 + with: + name: npm + path: npm - name: Download library uses: actions/download-artifact@v2 with: @@ -222,6 +228,12 @@ jobs: asset_path: ./dist/html2canvas.esm.js asset_name: html2canvas.esm.js asset_content_type: text/javascript + - name: Unpack npm + run: cd npm && tar -xvzf "html2canvas.tgz" + - name: NPM Publish (github) + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} docs: runs-on: ubuntu-latest name: Build docs @@ -275,7 +287,7 @@ jobs: publish-docs: runs-on: ubuntu-latest name: Publish Docs - if: ${{ github.ref == 'refs/heads/master' }} + if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }} needs: docs steps: - uses: actions/checkout@v2 @@ -290,7 +302,7 @@ jobs: uses: JamesIves/github-pages-deploy-action@3.5.9 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages-test + BRANCH: gh-pages FOLDER: docs SINGLE_COMMIT: true CLEAN: true