chore(husky): add husky and run prettier pre-commit (#77) #1
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
# yarn dlx np patch --no-publish --message "Release v%s" | |
name: Publish Package to npmjs | |
on: | |
push: | |
branches: ["main"] | |
permissions: | |
actions: write | |
contents: write | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
if: "startsWith(github.event.head_commit.message, 'Release v')" | |
environment: | |
name: npm-publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Enable corepack | |
run: corepack enable | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
cache: "yarn" | |
- name: Delete non-packaged files # yarn has problems when it comes to packaging, behaving differently from npm | |
run: rm -rf docs CHANGELOG.md | |
- name: Install Dependencies | |
run: yarn --immutable | |
- name: Publish | |
run: yarn npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
update_changelog: | |
needs: publish | |
runs-on: ubuntu-latest | |
environment: | |
name: npm-publish | |
steps: | |
- name: Generate CHANGELOG | |
uses: ./.github/workflows/update-changelog.yml | |
env: | |
CHANGELOG_GITHUB_TOKEN: ${{ secrets.CHANGELOG_GITHUB_TOKEN }} | |
update_docs: | |
needs: update_changelog | |
runs-on: ubuntu-latest | |
environment: | |
name: npm-publish | |
steps: | |
- name: Generate Docs | |
uses: ./.github/workflows/update-generated-docs.yml |