Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

[🚚 CI] Generate build from main #4

[🚚 CI] Generate build from main

[🚚 CI] Generate build from main #4

name: Package and publish NPM package
on:
workflow_dispatch:
push:
branches:
- build
paths:
- "export/**"
- ".github/workflows/package-and-publish-npm-package.yml"
jobs:
package-and-publish-npm-package:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensures tags are also fetched
- name: Clean up
run: |
rm export/tygo.yml
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
scope: "@kthcloud"
- name: Bump NPM version
run: |
git config user.name github-actions
git config user.email github-actions@github.com
npm version patch
working-directory: ./export
- name: Publish
run: npm publish --access public
working-directory: ./export
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push changes
run: |
BRANCH_NAME=${GITHUB_HEAD_REF}
git add . && git commit -m "Bump npm package version" && git push