Skip to content

Merge pull request #8 from xponential-asia/fix/package-json-prepare-cmd #8

Merge pull request #8 from xponential-asia/fix/package-json-prepare-cmd

Merge pull request #8 from xponential-asia/fix/package-json-prepare-cmd #8

Workflow file for this run

name: Release
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn
- run: yarn build # Build step
release:
name: Semantic Release
runs-on: ubuntu-latest
needs: build # This ensures 'release' job waits for 'build' to finish first
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install dependencies for release
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org/'
cache: 'yarn'
- name: Install dependencies
run: yarn
- name: Semantic Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish package to NPM 📦
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}