-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (54 loc) · 1.92 KB
/
release-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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Release & Publish
on:
push:
branches:
- master
jobs:
job:
# Ignore the heap-code bot commits and devDependencies
if: ${{ github.actor != vars.HC_BOT && !(github.actor == 'renovate[bot]' && contains(github.event.head_commit.message, 'chore(deps):')) }}
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.HC_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.HC_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: "npm"
- name: Install packages
run: npm ci
- name: Generate code coverage summary
run: npm run test:coverage -- --ci --coverageReporters json-summary
- name: Generating coverage badges
uses: jpb06/jest-badges-action@latest
with:
coverage-summary-path: ./coverage/coverage-summary.json
no-commit: true
output-folder: ./.badges/code/
- name: Set default code coverage badge
run: cp .badges/code/coverage-jest\ coverage.svg .badges/code/coverage.svg
- name: Generate comment coverage badge
run: npm run compodoc:build
- name: Move generated comment badge
run: cp dist/compodoc/images/coverage-badge-documentation.svg ./.badges/comment/coverage.svg
- name: git config
run: |
git config user.name "heap-code[bot]"
git config user.email "${{ vars.HC_BOT }}@users.noreply.github.com"
- name: add badges
run: git add .badges
# NPM publish
- name: Clean for build
run: rm -r dist/
- name: Build
run: npm run build:all
- name: Set npm config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
- name: Release
run: npx release-it --ci --no-git.requireCleanWorkingDir