Permissions #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🚀 Release Canary | |
on: | |
push: | |
branches: | |
- "canary" | |
jobs: | |
test: | |
name: 🧪 Run tests | |
runs-on: ubuntu-latest | |
outputs: | |
react-email: ${{ steps.filter.outputs.react-email }} | |
cli: ${{ steps.filter.outputs.cli }} | |
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: 🔍 Filter changes | |
id: filter | |
uses: dorny/paths-filter@v2 | |
with: | |
filters: | | |
react-email: | |
- 'packages/react-email/src/**' | |
cli: | |
- 'packages/cli/src/**' | |
publish-cli: | |
name: 🚀 Publish CLI | |
if: needs.test.outputs.cli == 'true' | |
needs: [test] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
id-token: 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 --snapshot canary | |
commit: "chore: update versions" | |
title: "chore: update versions" | |
publish: bun run changeset publish --tag canary | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish-react-email: | |
name: 🚀 Publish React Email | |
if: needs.test.outputs.react-email == 'true' | |
needs: [test] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
id-token: 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 --snapshot canary | |
commit: "chore: update versions" | |
title: "chore: update versions" | |
publish: bun run changeset publish --tag canary | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |