added semantic-release plugins #35
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 NPM Package | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
tags: | |
- v[1-9]+.[0-9]+.[0-9]+ | |
jobs: | |
test-build-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 📂 Checkout | |
uses: actions/checkout@v3 | |
- name: ⚙️ Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "lts/*" | |
registry-url: "https://registry.npmjs.org" | |
- name: 🐈⬛ Configure github user | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
- name: 📰 Semantic Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npx semantic-release | |
- name: 🧪 Test | |
run: | | |
npm ci | |
npm run test | |
- name: 🏗️ Build | |
run: npm run build | |
env: | |
CI: false | |
- run: | | |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc | |
npx release-it --ci --npm.skipChecks | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |