44
44
runs-on : ' ubuntu-24.04'
45
45
steps :
46
46
- uses : ' actions/checkout@v4'
47
- - uses : ./.github/actions/js/setup
47
+ - uses : ' actions/setup-node@v4'
48
+ with :
49
+ node-version : ' 22.11.0'
50
+ - name : ' install udev for usb-detection'
51
+ run : |
52
+ # WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
53
+ sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
54
+ sudo apt-get update && sudo apt-get install libudev-dev
55
+ - name : ' cache yarn cache'
56
+ uses : actions/cache@v4
57
+ with :
58
+ path : |
59
+ ${{ github.workspace }}/.yarn-cache
60
+ ${{ github.workspace }}/.npm-cache
61
+ key : js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
62
+ restore-keys : |
63
+ js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
64
+ - name : ' setup-js'
65
+ run : |
66
+ npm config set cache ./.npm-cache
67
+ make setup-js
48
68
- name : ' run components unit tests'
49
69
run : make -C components test-cov
50
70
- name : ' Upload coverage report'
60
80
needs : ['js-unit-test']
61
81
steps :
62
82
- uses : ' actions/checkout@v4'
63
- - uses : ./.github/actions/js/setup
83
+ - uses : ' actions/setup-node@v4'
84
+ with :
85
+ node-version : ' 22.11.0'
86
+ - name : ' install udev for usb-detection'
87
+ run : |
88
+ # WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
89
+ sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
90
+ sudo apt-get update && sudo apt-get install libudev-dev
91
+ - name : ' cache yarn cache'
92
+ uses : actions/cache@v4
93
+ with :
94
+ path : |
95
+ ${{ github.workspace }}/.yarn-cache
96
+ ${{ github.workspace }}/.npm-cache
97
+ key : js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
98
+ restore-keys : |
99
+ js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
100
+ - name : ' setup-js'
101
+ run : |
102
+ npm config set cache ./.npm-cache
103
+ yarn config set cache-folder ./.yarn-cache
104
+ make setup-js
64
105
- name : ' build components'
65
106
run : make -C components
66
107
- name : ' upload github artifact'
@@ -100,7 +141,22 @@ jobs:
100
141
if : needs.determine-build-type.outputs.type != 'none'
101
142
steps :
102
143
- uses : ' actions/checkout@v4'
103
- - uses : ./.github/actions/js/setup
144
+ # https://github.com/actions/checkout/issues/290
145
+ - name : ' Fix actions/checkout odd handling of tags'
146
+ if : startsWith(github.ref, 'refs/tags')
147
+ run : |
148
+ git fetch -f origin ${{ github.ref }}:${{ github.ref }}
149
+ git checkout ${{ github.ref }}
150
+ - uses : ' actions/setup-node@v4'
151
+ with :
152
+ node-version : ' 22.11.0'
153
+ - name : ' set complex environment variables'
154
+ id : ' set-vars'
155
+ uses : actions/github-script@v6
156
+ with :
157
+ script : |
158
+ const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
159
+ buildComplexEnvVars(core, context)
104
160
- name : ' download components build'
105
161
uses : ' actions/download-artifact@v4'
106
162
with :
@@ -125,7 +181,26 @@ jobs:
125
181
if : needs.determine-build-type.outputs.type == 'publish'
126
182
steps :
127
183
- uses : ' actions/checkout@v4'
128
- - uses : ./.github/actions/js/setup
184
+ # https://github.com/actions/checkout/issues/290
185
+ - name : ' Fix actions/checkout odd handling of tags'
186
+ if : startsWith(github.ref, 'refs/tags')
187
+ run : |
188
+ git fetch -f origin ${{ github.ref }}:${{ github.ref }}
189
+ git checkout ${{ github.ref }}
190
+ - uses : ' actions/setup-node@v4'
191
+ with :
192
+ node-version : ' 22.11.0'
193
+ registry-url : ' https://registry.npmjs.org'
194
+ - name : ' install udev for usb-detection'
195
+ run : |
196
+ # WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
197
+ sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
198
+ sudo apt-get update && sudo apt-get install libudev-dev
199
+ - name : ' setup-js'
200
+ run : |
201
+ npm config set cache ./.npm-cache
202
+ yarn config set cache-folder ./.yarn-cache
203
+ make setup-js
129
204
- name : ' build typescript types'
130
205
run : make -C components build-ts
131
206
# replace package.json stub version number with version from tag
@@ -136,9 +211,15 @@ jobs:
136
211
json -I -f ./components/package.json -e "this.version=\"$VERSION_STRING\""
137
212
json -I -f ./components/package.json -e "this.dependencies['@opentrons/shared-data']=\"$VERSION_STRING\""
138
213
json -I -f ./components/package.json -e "delete this.dependencies['@opentrons/step-generation']"
139
-
214
+ - uses : ' actions/setup-node@v4'
215
+ with :
216
+ node-version : ' 22.11.0'
217
+ registry-url : ' https://registry.npmjs.org'
140
218
- name : ' publish to npm registry'
141
219
env :
142
220
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
143
- run : npm publish --access public
144
- working-directory : ./components
221
+ run : |
222
+ cd ./components
223
+ echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ./.npmrc
224
+ ls -R # Debug: View contents of ./components
225
+ npm publish --access public
0 commit comments