Skip to content

Merge pull request #3 from nicolethoen/fix/add-package-lock-json #2

Merge pull request #3 from nicolethoen/fix/add-package-lock-json

Merge pull request #3 from nicolethoen/fix/add-package-lock-json #2

Workflow file for this run

name: Release
on:
push:
branches:
- main
jobs:
call-build-lint-test-workflow:
uses: ./.github/workflows/build-lint-test.yml
deploy:
runs-on: ubuntu-latest
needs: [call-build-lint-test-workflow]
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Cache node modules
uses: actions/cache@v4
id: npm-cache
with:
path: node_modules
key: ${{ runner.os }}-node-20-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-20-
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Cache dist
uses: actions/cache@v4
id: dist
with:
path: dist
key: ${{ runner.os }}-dist-${{ hashFiles('package-lock.json', 'package.json', 'src/**/*', 'rollup.config.js', 'tsconfig.json') }}
- name: Build dist
run: npm run build
if: steps.dist.outputs.cache-hit != 'true'
- name: Release to NPM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release