fix tests and trigger build #29
This file contains hidden or 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 | |
# publish only when package json has changed - assuming version upgrade | |
on: | |
push: | |
branches: [main] | |
paths: "lib/package.json" | |
jobs: | |
publish: | |
# Don't run just after creating repo from template | |
# Also avoid running after merging set-up PR | |
if: github.run_number > 2 && github.event.repository.owner.login == 'react18-tools' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
actions: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
run_install: true | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: "https://registry.npmjs.org" | |
cache: "pnpm" | |
- name: Setup Git | |
run: | | |
git config --global user.name "mayank1513" | |
git config --global user.email "[email protected]" | |
- name: Test | |
run: pnpm test | |
working-directory: ./lib | |
- name: Copy Readme file | |
run: cp ./README.md ./lib # will be uncommented while rebranding | |
- name: Apply changesets, publish and create release, branches and tags | |
run: pnpm tsx ./scripts/publish.ts | |
env: | |
BRANCH: ${{ github.ref_name }} | |
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run docs workflow as it will fail when trying to make parallel updates | |
run: gh workflow run docs.yml | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |