Skip to content

Handle diff keys correctly (#40) #9

Handle diff keys correctly (#40)

Handle diff keys correctly (#40) #9

Workflow file for this run

name: 🚀 Release Production
on:
push:
branches:
- main
jobs:
test:
name: 🧪 Run tests
runs-on: ubuntu-latest
outputs:
react-email-changed: ${{ env.react-email-changed }}
cli-changed: ${{ env.cli-changed }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: 📦 Install dependencies
run: bun install
- name: 🔍 Run type checking
run: bun run typecheck
# - name: 🔬 Run linting
# run: bun run lint
- name: 🧪 Run unit tests
run: bun run test
- name: Check package changes
id: check-changes
run: |
npx changeset status --since=HEAD > status.txt
if grep -q 'packages/react-email' status.txt; then
echo "react-email-changed=true" >> $GITHUB_ENV
else
echo "react-email-changed=false" >> $GITHUB_ENV
fi
if grep -q 'packages/cli' status.txt; then
echo "cli-changed=true" >> $GITHUB_ENV
else
echo "cli-changed=false" >> $GITHUB_ENV
fi
publish-cli:
name: 🚀 Publish CLI
needs: [test]
runs-on: ubuntu-latest
if: needs.test.outputs.cli-changed == 'true'
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: 📦 Install dependencies
run: bun install
- name: 🏗️ Build
working-directory: packages/cli
run: bun run build
- name: 🚀 Create and publish versions
uses: changesets/action@master
with:
version: bun run changeset version
commit: "chore: update versions"
title: "chore: update versions"
publish: bun run changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-react-email:
name: 🚀 Publish React Email
needs: [test]
runs-on: ubuntu-latest
if: needs.test.outputs.react-email-changed == 'true'
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: 📦 Install dependencies
run: bun install
- name: 🏗️ Build
working-directory: packages/react-email
run: bun run build
- name: 🚀 Create and publish versions
uses: changesets/action@master
with:
version: bun run changeset version
commit: "chore: update versions"
title: "chore: update versions"
publish: bun run changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}