diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e414a07..1980bfd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,11 @@ on: push: tags: - 'v*' + branches: + - 'next*' + pull_request: + branches: + - master jobs: build: @@ -17,38 +22,33 @@ jobs: node-version: 13.x registry-url: 'https://registry.npmjs.org' - - name: Install dependencies # Install all deps + - name: Install dependencies run: yarn - name: Build run: yarn build - - name: Publish NPM + # Publish with STABLE + - name: Publish NPM latest + if: startsWith(github.ref, 'refs/tags/v') # run only with tag run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - # Publish to GitHub Package Registry - # - name: Set up package for GPR - # run: yarn gpr:setup - - # - name: Use GPR - # uses: actions/setup-node@master - # with: - # node-version: 13 - # registry-url: https://npm.pkg.github.com/ - # scope: '@bartholomej' - - # - name: Publish to GitHub Package Registry - # run: | - # npm publish - # env: - # NODE_AUTH_TOKEN: ${{github.token}} + # Publish with NEXT tag + - name: Publish NPM next! + if: github.ref == 'refs/heads/next' # run only with NEXT branch + run: npm publish --tag next + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + # Deploy Github Pages (only with v* tag) - name: Prepare Github Pages + if: startsWith(github.ref, 'refs/tags/v') # run only with tag run: cp -r dist/ demo/dist/ - name: Deploy Github Pages + if: startsWith(github.ref, 'refs/tags/v') # run only with tag uses: peaceiris/actions-gh-pages@v2 env: ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} diff --git a/package.json b/package.json index 844f7f9..c64120d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "material-scrolltop", - "version": "2.0.0", + "version": "2.0.1-next.2", "description": "Lightweight, Material Design inspired plugin for scrolling on top of the html page (with jQuery)", "main": "./dist/material-scrolltop.js", "types": "./dist/material-scrolltop.d.ts",