-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (67 loc) · 2.02 KB
/
Copy pathpublish.yml
File metadata and controls
67 lines (67 loc) · 2.02 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
62
63
64
65
66
67
jobs:
pipeline:
name: publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup git
run: |-
git config --local user.email github_bot@users.noreply.github.com
git config --local user.name GithubBot
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 22.16.0
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.11.1
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: node_modules
key: pnpm-cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install deps
env:
HUSKY: 0
SKIP_INSTALL_SIMPLE_GIT_HOOKS: 1
SKIP_SIMPLE_GIT_HOOKS: 1
run: pnpm install --frozen-lockfile
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Updated npm version and create commit
run: |-
npm pkg set version=${{ steps.tag_version.outputs.new_version }}
git add -A
git commit -m "chore: published tag ${{steps.tag_version.outputs.new_tag}}"
- name: Run build
env:
NODE_ENV: production
run: |
pnpm build
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Publish library to npm
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
name: publish
on:
push:
branches:
- master
permissions:
contents: write
id-token: write