Skip to content

Target ES2022 (#149) #490

Target ES2022 (#149)

Target ES2022 (#149) #490

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node_version:
- 20
name: Node ${{ matrix.node_version }} on ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Reason
run: "echo ref: ${{github.ref}} event: ${{github.event_name}}"
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
registry-url: "https://registry.npmjs.org"
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ matrix.node_version }}-${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
- name: Set Min Version
uses: Stelzi79/[email protected]
id: version
with:
minimum-major-minor: 3.0
tag-prefix: v
- name: Build Version
run: |
npm install --global replace-in-files-cli
replace-in-files --string="3.0.0-dev" --replacement=${{steps.version.outputs.version}} packages/core/src/configuration/Configuration.ts
replace-in-files --string="3.0.0-dev" --replacement=${{steps.version.outputs.version}} **/package*.json
npm install
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Run Tests
run: npm test
- name: Publish Release Packages
if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest'
run: npm publish --workspaces --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Setup GitHub CI Node.js environment
if: github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
registry-url: "https://npm.pkg.github.com"
scope: "@exceptionless"
- name: Push GitHub CI Packages
if: github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest'
run: npm publish --workspaces --access public
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}