Merge pull request #57 from alextim/astro-3 #98
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 | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- '.changeset/**' | |
- 'packages/**' | |
- '!examples/**' | |
- '!.github/**' | |
- '!.husky/**' | |
- '!.vscode/**' | |
- '!**/README.md' | |
- '!**/CHANGELOG.md' | |
- '!**/LICENSE' | |
- '!packages/**/__tests__/**' | |
# Automatically cancel in-progress actions on the same branch | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: 0 | |
- name: Setup PNPM | |
id: pnpm-install | |
uses: pnpm/action-setup@v2 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Lint | |
run: pnpm run lint | |
- name: Build Packages | |
run: pnpm run build | |
- name: Test | |
run: pnpm run test | |
- name: Typecheck | |
run: pnpm run typecheck | |
- name: Create Release Pull Request or Publish | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
# Note: pnpm install after versioning is necessary to refresh lockfile | |
version: pnpm run version | |
publish: pnpm exec changeset publish | |
commit: '[ci] release' | |
title: '[ci] release' | |
env: | |
# Needs access to push to main | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Needs access to publish to npm | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |