Merge pull request #177 from pangolindex/dev - Production v5.3.8 #76
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: npm | |
env: | |
CI: true | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
Release: | |
runs-on: ubuntu-latest | |
env: | |
PANGOLIN_NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # this is useful for .npmrc file | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.head_ref }} | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
- uses: actions/[email protected] | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Configure Git | |
run: | | |
git config --global user.name 'Pangolin' | |
git config --global user.email '[email protected]' | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ env.node_version }} | |
registry-url: 'https://registry.npmjs.org/' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: yarn --frozen-lockfile | |
env: | |
CI: true | |
- name: Prod - Increment version & create build # incrementing version automatically creates build internally with new version | |
run: npm version patch -m "[skip ci] %s" | |
if: ${{ github.ref == 'refs/heads/master' }} | |
env: | |
CI: false | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GIT_ACCESS_TOKEN }} | |
branch: ${{ github.ref }} | |
tags: true | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |