Skip to content

Commit 8f01002

Browse files
committed
workflow back to edge
1 parent 8bdc03e commit 8f01002

File tree

1 file changed

+88
-7
lines changed

1 file changed

+88
-7
lines changed

.github/workflows/components-test-build-deploy.yaml

Lines changed: 88 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,27 @@ jobs:
4444
runs-on: 'ubuntu-24.04'
4545
steps:
4646
- 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
4868
- name: 'run components unit tests'
4969
run: make -C components test-cov
5070
- name: 'Upload coverage report'
@@ -60,7 +80,28 @@ jobs:
6080
needs: ['js-unit-test']
6181
steps:
6282
- 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
64105
- name: 'build components'
65106
run: make -C components
66107
- name: 'upload github artifact'
@@ -100,7 +141,22 @@ jobs:
100141
if: needs.determine-build-type.outputs.type != 'none'
101142
steps:
102143
- 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)
104160
- name: 'download components build'
105161
uses: 'actions/download-artifact@v4'
106162
with:
@@ -125,7 +181,26 @@ jobs:
125181
if: needs.determine-build-type.outputs.type == 'publish'
126182
steps:
127183
- 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
129204
- name: 'build typescript types'
130205
run: make -C components build-ts
131206
# replace package.json stub version number with version from tag
@@ -136,9 +211,15 @@ jobs:
136211
json -I -f ./components/package.json -e "this.version=\"$VERSION_STRING\""
137212
json -I -f ./components/package.json -e "this.dependencies['@opentrons/shared-data']=\"$VERSION_STRING\""
138213
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'
140218
- name: 'publish to npm registry'
141219
env:
142220
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

Comments
 (0)