forked from finos/FDC3
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.57 KB
/
package.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: npm-build
# Only trigger on:
# - master branch
# - PR or Pull Request event types
# - Exclide Docusaurus files: this file, docs/** and website/**
on:
push:
branches:
- master
- release/**
paths-ignore:
- '.github/workflows/docusaurus.yml'
- 'docs/**'
- 'website/**'
pull_request:
branches:
- master
- release/*
paths-ignore:
- '.github/workflows/docusaurus.yml'
- 'docs/**'
- 'website/**'
jobs:
package-build:
name: Build on Node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [18.16.x]
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
uses: bahmutov/npm-install@c5482d70ec8706408996e31ac94075030694993f #v1.8.32
- name: Lint
run: yarn lint
- name: Test
run: yarn test --ci --coverage --maxWorkers=2
- name: Build
run: yarn build
pacakge-publish:
if: ${{ github.event_name == 'push' }}
needs: package-build
name: Publish package to ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: NPM
registry: https://registry.npmjs.org
token-name: NPM_TOKEN
- name: GitHub
registry: https://npm.pkg.github.com
token-name: GITHUB_TOKEN
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Configure Node
uses: actions/setup-node@v1
with:
node-version: 18.16.x
registry-url: ${{ matrix.registry }}
- name: Check package version
id: check-version
uses: PostHog/check-package-version@adccce0ed9759513476413668bd2a5c995450bde #v2.0.0
- name: Package version info
run: |
echo "Committed version: ${{ steps.check-version.outputs.committed-version }}"
echo "Published version: ${{ steps.check-version.published-version }}"
echo "Is version new: ${{ steps.check-version.outputs.is-new-version }}"
- name: Install dependencies
if: steps.check-version.outputs.is-new-version == 'true'
uses: bahmutov/npm-install@c5482d70ec8706408996e31ac94075030694993f #v1.8.32
- name: Publish
if: steps.check-version.outputs.is-new-version == 'true'
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets[matrix.token-name] }}