Skip to content

0.1.5

0.1.5 #1

Workflow file for this run

name: Release & Publish
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Get Changelog
id: changelog
run: |
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -z "$PREVIOUS_TAG" ]; then
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
git log --pretty=format:"* %s" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
else
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
git log --pretty=format:"* %s" $PREVIOUS_TAG..HEAD >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
fi
- run: npm ci
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body: ${{ env.CHANGELOG }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}