Skip to content

Merge pull request #987 from hayes/changeset-release/main #806

Merge pull request #987 from hayes/changeset-release/main

Merge pull request #987 from hayes/changeset-release/main #806

Workflow file for this run

name: Changesets
on:
push:
branches:
- main
env:
CI: true
jobs:
version:
timeout-minutes: 15
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
issues: write
repository-projects: write
deployments: write
packages: write
pull-requests: write
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
ports:
- '5455:5432'
env:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
POSTGRES_DB: tests
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2.2.4
name: Install pnpm
id: pnpm-install
with:
run_install: false
version: ^8.1.0
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Setup turbo cache
uses: actions/cache@v3
with:
path: node_modules/.cache
key: turbo-${{ runner.os }}-18-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
email=michael@hayes.io
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Create PR or Publish release
id: changesets
uses: changesets/action@v1
with:
version: pnpm run ci:version
commit: 'chore: update versions'
title: 'chore: update versions'
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}