This repository was archived by the owner on Jan 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
61 lines (52 loc) 路 1.77 KB
/
Copy pathpublish.yml
File metadata and controls
61 lines (52 loc) 路 1.77 KB
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
name: "Publish"
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
check-package-version:
name: Check package version and detect an update
runs-on: ubuntu-24.04
outputs:
committed-version: ${{ steps.check-package-version.outputs.committed-version }}
published-version: ${{ steps.check-package-version.outputs.published-version }}
is-new-version: ${{ steps.check-package-version.outputs.is-new-version }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Check package version and detect an update
id: check-package-version
uses: PostHog/check-package-version@v2
with:
path: typescript/
release:
name: Publish release if new version
runs-on: ubuntu-24.04
needs: check-package-version
if: needs.check-package-version.outputs.is-new-version == 'true'
env:
COMMITTED_VERSION: ${{ needs.check-package-version.outputs.committed-version }}
PUBLISHED_VERSION: ${{ needs.check-package-version.outputs.published-version }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node 18
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org
- name: Install pnpm
run: npm install -g pnpm
- name: Install package.json dependencies with pnpm
run: cd typescript && pnpm install
- name: Build the package
run: cd typescript && pnpm build
- name: Publish the package in the npm registry
run: cd typescript && pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}