This repository has been archived by the owner on Nov 11, 2023. It is now read-only.
71 lines (69 loc) 路 2.32 KB
/
npm-publish.yaml
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
name: Npm publish
on:
push:
branches:
- master
paths:
- package.json
jobs:
npm-publish:
name: Publish on npm
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build & publish to npm
uses: actions/setup-node@v1
with:
node-version: 12.16.1 # workaround https://github.com/babel/babel/issues/11216
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
npm-publish-without-cli:
name: Publish on npm (without-cli version)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build & publish a without-cli version to npm
uses: actions/setup-node@v1
with:
node-version: 12.16.1 # workaround https://github.com/babel/babel/issues/11216
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn build
- run: node publish-without-cli.js
- run: npm publish --tag without-cli
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
github-release:
name: Create a github release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Retrieve current version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: Generate release changelog
uses: actions/setup-node@v1
with:
node-version: 12.16.1 # workaround https://github.com/babel/babel/issues/11216
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn auto-changelog --starting-version v${{ steps.package-version.outputs.current-version}} --template github-release.hbs -o releasenotes.md
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.package-version.outputs.current-version}}
release_name: v${{ steps.package-version.outputs.current-version}}
body_path: releasenotes.md
draft: false
prerelease: false