build: add npm auth #28
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.REPO_PAT }} | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18.x" | |
- name: configure git | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
- name: Install dependencies | |
run: | | |
corepack enable | |
yarn --immutable | |
- name: Build | |
run: yarn build | |
- name: Run tests | |
run: yarn test | |
- name: Version | |
if: github.ref == 'refs/heads/main' | |
run: | | |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc | |
yarn nx affected --base=last-release --target=version --parallel=1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Tag last-release | |
if: github.ref == 'refs/heads/main' | |
run: | | |
git tag -f last-release | |
git push origin last-release --force |