Skip to content

feat: add npm publishing to CI #1

feat: add npm publishing to CI

feat: add npm publishing to CI #1

name: Publish Github Release
on:
push:
branches:
- 'alpha'
- 'beta'
- 'main'
jobs:
release:
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Project
uses: ./.github/actions/setup
- name: Build Project
run: npm run build
- name: Semantic Release
run: npx semantic-release
- name: Publish to npm
run: npm publish ./dist/*.tgz --tag ${{ env.BRANCH_NAME == 'main' && 'latest' || '$BRANCH_NAME' }}