ci: Fix publish #21
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Install pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 'latest' | |
- name: Install Dependencies | |
run: pnpm install | |
- name: Build Project (TypeScript to JavaScript) | |
run: pnpm build | |
- name: Run Unit Tests | |
run: pnpm test | |
publish: | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/main' }} | |
needs: [tests] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Install pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 'latest' | |
- name: Install Dependencies | |
run: pnpm install | |
- name: Build Project (TypeScript to JavaScript) | |
run: pnpm build | |
- name: Create Release | |
run: pnpm run release | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |