Merge pull request #3 from nicolethoen/fix/add-package-lock-json #2
This file contains hidden or 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 | |
| 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 | |