generated from md2docx/md2docx-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.59 KB
/
publish.yml
File metadata and controls
52 lines (48 loc) · 1.59 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
name: Publish to NPM
# publish only when package json has changed - assuming version upgrade
on:
push:
branches: [main]
paths: "lib/package.json"
jobs:
publish:
# Don't run just after creating repo from template
# Also avoid running after merging set-up PR
if: github.event.repository.owner.login == 'md2docx'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
actions: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: true
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- name: Setup Git
run: |
git config --global user.name "mayank1513"
git config --global user.email "mayank.srmu@gmail.com"
- name: Test
run: pnpm test
working-directory: ./lib
- name: Copy Readme file
run: cp ./README.md ./lib # will be uncommented while rebranding
- name: Apply changesets, publish and create release, branches and tags
run: pnpm tsx ./scripts/publish.ts
env:
BRANCH: ${{ github.ref_name }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}