fetch all history of the repo on the publish workflow #7
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: Publish to NPM | |
on: | |
push: | |
branches: | |
- master | |
- abanoubghadban/sc-65675/implement-continous-deployment-on-github | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Fetch tags | |
run: git fetch --prune --unshallow | |
- name: Setup Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies and build 🔧 | |
run: yarn install --frozen-lockfile | |
- name: find changes | |
run: lerna changed --ignore-changes '**/*.md' '**/test/*' '**/__snapshots__/*' '**/*.test.{ts,tsx,js,jsx}' | |
- name: Ensure that "lerna version" has been run | |
run: | | |
changed=$(yarn run --silent changed) | |
if [ -n "$changed" ]; then | |
echo "Error: Found changed packages. Please run 'yarn run version' before pushing changes." >&2 | |
exit 1 | |
fi | |
- name: Publish package on NPM 📦 | |
run: yarn run lerna publish from-package --yes --dist-tag experimental | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |