-
Notifications
You must be signed in to change notification settings - Fork 2.1k
57 lines (48 loc) · 1.77 KB
/
release-npm.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
55
56
57
name: release-npm
on:
repository_dispatch:
types: [renovate-release]
env:
YARN_MODULES_CACHE_KEY: v1
YARN_PACKAGE_CACHE_KEY: v1
YARN_CACHE_FOLDER: .cache/yarn
NODE_VERSION: 14
jobs:
release-npm:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2.1.5
with:
node-version: ${{ env.NODE_VERSION }}
- name: Init platform
run: |
git config --global core.autocrlf false
git config --global core.symlinks true
git config --global user.email 'renovate@whitesourcesoftware.com'
git config --global user.name 'Renovate Bot'
yarn config set version-git-tag false
npm config set scripts-prepend-node-path true
- uses: actions/checkout@v2.3.4
with:
ref: ${{ github.event.client_payload.sha }}
- name: Cache Yarn packages
id: yarn_cache_packages
uses: actions/cache@v2.1.5
with:
path: ${{ env.YARN_CACHE_FOLDER }}
key: ${{ env.YARN_PACKAGE_CACHE_KEY }}-${{ runner.os }}-yarn_cache-${{ hashFiles('**/yarn.lock') }}
- name: Installing dependencies
run: yarn install --frozen-lockfile
- name: Build ${{ github.event.client_payload.version }}
run: yarn build
- name: Prepare ${{ github.event.client_payload.version }}
run: |
npm --no-git-tag-version version ${{ github.event.client_payload.version }}
- name: Publish ${{ github.event.client_payload.version }}
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ~/.npmrc
npm publish --tag ${TAG:-latest}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
TAG: ${{ github.event.client_payload.tag }}