feat: push github actions to publish package #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
name: Publish CI | |
on: | |
push: | |
branches: [master] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
registry-url: "https://npm.pkg.github.com" | |
scope: "@euler-xyz" | |
- run: npm ci | |
- run: npm run build --if-present | |
- run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
npm version patch | |
git push | |
git push --tags | |
- run: npm publish --access restricted | |
env: | |
# NOTE: using the built-in GITHUB token here because we're publishing to THIS repository's packages. | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |