Merge pull request #679 from seb-oss/dependabot/npm_and_yarn/opentele… #737
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: | |
push: | |
branches: | |
- main | |
# Cancel previously running workflows | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
analyze: | |
name: Analyze with CodeQL | |
runs-on: ubuntu-latest | |
timeout-minutes: 360 | |
permissions: | |
security-events: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Cache Yarn dependencies | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
.yarn/cache | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: javascript | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
licenses: | |
name: Check licenses | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Cache Yarn dependencies | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
.yarn/cache | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Run license check | |
run: node tools/check-licenses.mjs | |
test: | |
name: Tests | |
needs: [licenses] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Cache Yarn dependencies | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
.yarn/cache | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Run tests | |
run: yarn test | |
lint: | |
name: Lint | |
needs: [licenses] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Cache Yarn dependencies | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
.yarn/cache | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Setup Biome | |
uses: biomejs/setup-biome@v2 | |
- name: Check linting, formatting, and imports | |
run: biome ci | |
typecheck: | |
name: Type check | |
needs: [licenses] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Cache Yarn dependencies | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
.yarn/cache | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Run type checking | |
run: yarn typecheck | |
changeset: | |
name: Create Release Pull Request or Publish to NPM | |
needs: [test, lint, typecheck, analyze] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Cache Yarn dependencies | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
.yarn/cache | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Create Changeset PR | |
uses: changesets/action@v1 | |
with: | |
publish: yarn release | |
commit: 'chore(release): update versions' | |
title: 'chore(release): update versions' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |