Skip to content

build: improve build stack #69

build: improve build stack

build: improve build stack #69

name: Release
on:
push:
branches:
- main
permissions: {}
jobs:
release-please:
permissions:
contents: write # to create release commit (google-github-actions/release-please-action)
pull-requests: write # to create release PR (google-github-actions/release-please-action)
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: kevlar-tabs
# Remove these lines after 1.0.0
#bump-minor-pre-major: true
#bump-patch-for-minor-pre-major: true
# The logic below handles the npm publication:
- name: Checkout 🛎️
uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- uses: pnpm/action-setup@v2
with:
run_install: |
- recursive: true
args: [--frozen-lockfile, --prefer-offline]
if: ${{ steps.release.outputs.release_created }}
- run: pnpm lint
if: ${{ steps.release.outputs.release_created }}
- run: pnpm test -- --run
if: ${{ steps.release.outputs.release_created }}
- run: pnpm build
if: ${{ steps.release.outputs.release_created }}
- run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
- name: New version notification
uses: neolitec/[email protected]
continue-on-error: true
if: ${{ steps.release.outputs.release_created }}
with:
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
title: 'New version of ${{ github.repository }}'
message: '🎉 We just released the version [${{ steps.release.outputs.tag_name }}](https://github.com/${{ github.repository }}/releases/tag/${{ steps.release.outputs.tag_name }})'