feat: crate .npmrc #27
Workflow file for this run
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: CI/CD | |
on: | |
push: | |
branches: | |
- main | |
- feat_sync | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: Production | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Get yarn cache directory | |
id: yarn-cache-dir | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Yarn cache | |
uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: ${{ runner.os }}-yarn- | |
- name: Debug NPM_TOKEN | |
run: | | |
echo "NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}" | |
echo "NPM_TOKEN_EMPTY: ${{ secrets.NPM_TOKEN_EMPTY }}" | |
- name: Yarn install | |
run: yarn install | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: Run Packages Tests | |
run: | | |
# yarn run test skip | |
- name: Build Packages | |
run: | | |
npx lerna exec --scope='@pagenote/*' --include-dependencies yarn build | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: Set Git Identity | |
run: | | |
git config --global user.name "${{ github.actor }}" | |
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
- name: Lerna Version | |
run: | | |
npx lerna version --no-push --no-private patch --yes | |
- name: Create .npmrc | |
run: echo 'registry=https://registry.npmjs.org' > .npmrc && echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc | |
- name: Publish to NPM | |
run: | | |
npx lerna publish from-git --yes --conventional-commits --conventional-graduate | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |