-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.73 KB
/
npm-publish.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
name: NPM Publish CLI Package + Release Action
on:
push:
branches:
- main
paths:
- packages/cli/package.json
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: pnpm/[email protected]
with:
version: 7
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "pnpm"
- name: Install Node Modules
run: pnpm i
- uses: JS-DevTools/npm-publish@v1
id: publish
with:
token: ${{ secrets.NPM_TOKEN }}
package: packages/cli/package.json
- name: Create release Branch and Tag
if: steps.publish.outputs.type != 'none'
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
git checkout -b 'release/v${{ steps.publish.outputs.version }}'
pnpm bundle
git add --force ./dist/index.js
git commit -m 'release v${{ steps.publish.outputs.version }}'
git push --set-upstream origin release/v${{ steps.publish.outputs.version }}
git tag v${{ steps.publish.outputs.version }} release/v${{ steps.publish.outputs.version }}
git push origin v${{ steps.publish.outputs.version }}
working-directory: packages/action
- name: release
uses: actions/create-release@v1
id: create_release
if: steps.publish.outputs.type != 'none'
with:
draft: false
prerelease: true
release_name: ${{ steps.publish.outputs.version }}
tag_name: v${{ steps.publish.outputs.version }}
env:
GITHUB_TOKEN: ${{ github.token }}