Skip to content

chore: freeze the lockfile #199

chore: freeze the lockfile

chore: freeze the lockfile #199

on:
push:
branches:
- master
name: release-please
jobs:
release-please:
if: github.repository == 'orefalo/svelte-splitpanes' # Prevent running on forks
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
# The whole Node.js and pnpm installation and caching
# Based on https://github.com/pnpm/action-setup/tree/6e1964dde3397a825e79e4607ad57f3f7ca2c7cb#use-cache-to-reduce-installation-time
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: SvelteKit Sync
run: npx svelte-kit sync
- name: Svelte Package
run: pnpm run package
- name: Release Please
uses: googleapis/release-please-action@v4
id: release
with:
release-type: node
- name: Upload the packed package
uses: actions/upload-release-asset@v1
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
node-version: 20
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: package/svelte-splitpanes-${{ steps.release.outputs.version }}.tgz
asset_name: svelte-splitpanes-${{ steps.release.outputs.version }}.tgz
asset_content_type: application/gzip
- name: Set NPM publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Publish to NPM
if: ${{ steps.release.outputs.release_created }}
run: pnpm publish --access=public