-
Notifications
You must be signed in to change notification settings - Fork 1
120 lines (96 loc) · 3.39 KB
/
ci.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI
on:
push:
branches: main
tags: "*/v*"
pull_request:
branches: "**"
jobs:
build:
name: ${{ matrix.package }}
strategy:
fail-fast: false
matrix:
package:
- ros1
- rosbag
- rosbag2
- rosbag2-node
- rosbag2-web
- rosmsg
- rosmsg-msgs-common
- rosmsg-serialization
- rosmsg2-serialization
- rostime
- xmlrpc
runs-on: ubuntu-latest
permissions:
contents: read
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
id-token: write
steps:
- uses: actions/checkout@v4.2.2
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4.1.0
with:
node-version: 22
registry-url: https://registry.npmjs.org
cache: yarn
- run: yarn install --immutable
- run: yarn workspaces foreach -Rp --topological-dev --from @foxglove/${{ matrix.package }} run build
- run: yarn lint:ci packages/${{ matrix.package }}
- run: yarn workspace @foxglove/${{ matrix.package }} run test
- name: build xmlrpc examples
if: ${{ matrix.package == 'xmlrpc' }}
run: yarn install --immutable && yarn tsc -b
working-directory: packages/xmlrpc/examples
- run: yarn workspace @foxglove/${{ matrix.package }} pack
- name: Publish to NPM (dry run)
# `yarn npm publish` does not currently support --provenance: https://github.com/yarnpkg/berry/issues/5430
run: npm publish packages/${{ matrix.package }}/package.tgz --provenance --access public --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Publish to NPM
if: ${{ startsWith(github.ref, format('refs/tags/{0}/v', matrix.package)) }}
# `yarn npm publish` does not currently support --provenance: https://github.com/yarnpkg/berry/issues/5430
run: npm publish packages/${{ matrix.package }}/package.tgz --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
rosbag-docs:
name: rosbag docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4.2.2
- run: corepack enable
- uses: actions/setup-node@v4.1.0
with:
node-version: 22
registry-url: https://registry.npmjs.org
cache: yarn
- run: yarn install --immutable
- run: yarn workspaces foreach -Rp --topological-dev --from @foxglove/rosbag run build
- run: yarn workspace @foxglove/rosbag docs
- name: Deploy to GitHub pages
uses: JamesIves/github-pages-deploy-action@v4.7.2
with:
branch: gh-pages
folder: packages/rosbag/docs
target-folder: rosbag-docs
rosmsg-serialization-bench:
name: rosmsg-serialization benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- run: corepack enable
- uses: actions/setup-node@v4.1.0
with:
node-version: 22
registry-url: https://registry.npmjs.org
cache: yarn
- run: yarn install --immutable
- run: yarn workspaces foreach -Rp --topological-dev --from @foxglove/rosmsg run build
- run: yarn workspace @foxglove/rosmsg bench:benny