-
-
Notifications
You must be signed in to change notification settings - Fork 19
71 lines (62 loc) · 2.21 KB
/
release-please.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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@v3
# 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@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v3
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: pnpm exec svelte-kit sync
- name: Svelte Package
run: npm run package
- name: Release Please
uses: google-github-actions/release-please-action@v3
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:
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: NPM Publish
if: ${{ steps.release.outputs.release_created }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: cd package && npm config set _authToken=$NPM_TOKEN && npm publish