Skip to content

Add announcement post #128

Add announcement post

Add announcement post #128

name: Release and Publish
on:
push:
branches:
- main
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
outputs:
released: ${{ steps.release.outputs.released }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Automatic GitHub Release
uses: justincy/github-action-npm-release@2.0.2
with:
path: ${{ github.workspace }}/packages/react-dialog-async
id: release
- name: Print release output
if: ${{ steps.release.outputs.released == 'true' }}
run: echo Release ID ${{ steps.release.outputs.release_id }}
publish-package:
name: Publish to NPM
needs: [create-release]
if: needs.create-release.outputs.released == 'true'
runs-on: ubuntu-latest
steps:
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 9.15.4
- name: Checkout project
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup node
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: 22
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: pnpm i
- name: Build project
working-directory: packages/react-dialog-async
run: pnpm build
- name: Run tests
working-directory: packages/react-dialog-async
run: pnpm test
- name: Publish the dist folder to npm
working-directory: packages/react-dialog-async
run: npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}