Skip to content

fix: build workflow #112

fix: build workflow

fix: build workflow #112

Workflow file for this run

name: Build & Publish
on:
push:
branches: [ prod, staging ]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
- uses: actions/setup-node@v3
with:
node-version: '18.19.0'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Typescript check
run: npm run ts:check
- name: Check eslint
run: npm run lint:check
- name: Test
run: npx c8 npm run test
- uses: actions/upload-artifact@master
with:
name: coverage-lcov
path: coverage
- name: Build
run: |
npm pkg delete scripts.prepare
npm run build
- name: Publish npm packages / create github release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
sonarcube:
runs-on: ubuntu-latest
needs: release
concurrency:
group: ${{ github.ref }}-sonarcube
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/download-artifact@master
with:
name: coverage-lcov
path: coverage
- id: package-version
run: npx @lomray/microservices-cli package-version
- uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }}
with:
args: >
-Dsonar.projectVersion=${{ steps.package-version.outputs.version }}