v1.0.2 #24
Workflow file for this run
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: CI/CD Pipeline | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
build-test-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Set up Bun | |
uses: oven-sh/setup-bun@v2 | |
- name: Install dependencies | |
run: bun i | |
- name: Build the project | |
run: bun run build | |
- name: Log in to npm | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
- name: Publish to npm | |
if: startsWith(github.ref, 'refs/tags/') | |
run: npm publish --access public | |
- name: Publish to GitHub Packages | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "@${{ github.repository_owner }}:registry=https://npm.pkg.github.com" >> ~/.npmrc | |
npm publish --registry=https://npm.pkg.github.com | |
- name: Upload Build Artifacts | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./dist | |
asset_name: build.zip | |
asset_content_type: application/zip |