Skip to content

Preview Release

Preview Release #38

Workflow file for this run

# https://github.com/stackblitz-labs/pkg.pr.new
name: Preview Release
on:
# push:
# branches: [main]
workflow_dispatch:
inputs:
branch:
description: 'Branch to release'
required: true
default: 'main'
permissions:
contents: read
jobs:
preview:
if: github.repository == 'web-infra-dev/rstest'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
ref: ${{ github.event.inputs.branch }}
- name: Install pnpm
run: |
npm install -g corepack@latest --force
corepack enable
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
predicate-quantifier: 'every'
filters: |
changed:
- "packages/**"
- "!packages/document/**"
- name: Setup Node.js
if: steps.changes.outputs.changed == 'true'
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: 22.x
cache: 'pnpm'
- name: Install Dependencies
if: steps.changes.outputs.changed == 'true'
run: pnpm install
- name: Publish Preview
id: publish
if: steps.changes.outputs.changed == 'true'
run: pnpx pkg-pr-new publish --pnpm ./packages/*
- name: Preview summary
if: steps.changes.outputs.changed == 'true'
run: |
sha='${{ steps.publish.outputs.sha }}'
packages='${{ steps.publish.outputs.packages }}'
urls='${{ steps.publish.outputs.urls }}'
shaDisplay="${sha:-N/A}"
{
echo "## pkg.pr.new preview"
echo ""
echo "**sha**: \`$shaDisplay\`"
if [ -n "$packages" ]; then
echo ""
echo "### packages"
echo ""
for pkg in $packages; do
echo "- \`$pkg\`"
done
fi
if [ -n "$urls" ]; then
echo ""
echo "### URLs"
echo ""
for url in $urls; do
echo "- <$url>"
done
fi
} >> "$GITHUB_STEP_SUMMARY"
echo "::notice title=pkg.pr.new::sha=$shaDisplay (see Summary for packages/urls)"