Skip to content

chore: release main #101

chore: release main

chore: release main #101

name: release-please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v2
with:
version: 8.10.5
# --------------
# RELEASE PLEASE
# --------------
- name: Run Release Please
uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{secrets.ACCESS_TOKEN}}
- name: Release created - checkout files
uses: actions/checkout@v3
with:
fetch-depth: 0
if: ${{ steps.release.outputs.release_created }}
# ----
# ROOT
# ----
- name: Root - Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- name: Root - Install dependencies
run: pnpm install --frozen-lockfile
if: ${{ steps.release.outputs.release_created }}
- name: Root - Build packages
run: pnpm build
working-directory: ./
if: ${{ steps.release.outputs.release_created }}
# -------------
# BAGGIE / CORE
# -------------
- name: Core - Check for changes
id: changed-core
uses: tj-actions/changed-files@v41
with:
files: |
packages/core/**
if: ${{ steps.release.outputs.release_created }}
- name: Core - Publish to NPM
run: pnpm publish
working-directory: ./packages/core
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: steps.changed-core.outputs.any_changed == 'true'
# --------------
# BAGGIE / REACT
# --------------
- name: React - Check for changes
id: changed-react
uses: tj-actions/changed-files@v41
with:
files: |
packages/react/**
if: ${{ steps.release.outputs.release_created }}
- name: React - Publish to NPM
run: pnpm publish
working-directory: ./packages/react
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: steps.changed-react.outputs.any_changed == 'true'
# ------------------
# BAGGIE / STORYBOOK
# ------------------
- name: StoryBook - Build website
run: pnpm build-storybook
working-directory: ./
if: steps.changed-core.outputs.any_changed == 'true' || steps.changed-react.outputs.any_changed == 'true'
# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: StoryBook - Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./storybook-static
user_name: larsmunkholm
user_email: [email protected]
if: steps.changed-core.outputs.any_changed == 'true' || steps.changed-react.outputs.any_changed == 'true'