Skip to content

Dan/migrate nylas connect (#3) #1

Dan/migrate nylas connect (#3)

Dan/migrate nylas connect (#3) #1

Workflow file for this run

name: Release
on:
push:
branches:
- main
workflow_dispatch:
# Prevent multiple releases from running at the same time
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: blacksmith-2vcpu-ubuntu-2404
permissions:
contents: write # to create release commits and tags
pull-requests: write # to create release PRs
id-token: write # for NPM provenance
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Need full history for changesets
fetch-depth: 0
# Use a token that can trigger workflows (for release PR creation)
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}
registry-url: "https://registry.npmjs.org"
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: "10.6.3"
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Type check
run: pnpm typecheck
- name: Check formatting
run: pnpm format:check
- name: Build packages
run: pnpm build
- name: Run tests
run: pnpm test
- name: Run tests with coverage
run: pnpm --filter @nylas/connect coverage
- name: Create Release Pull Request or Publish to NPM
id: changesets
uses: changesets/action@v1
with:
# This expects a script called "version" and "publish"
version: pnpm version
publish: pnpm publish:dry-run
title: "chore: version packages"
commit: "chore: version packages"
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true