Skip to content

Commit e08e1ec

Browse files
authored
build(profiling-node): Fix profiling-node tarball creation & caching (#10909)
Let's see if that fixes stuff...
1 parent d642b41 commit e08e1ec

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ env:
4949
${{ github.workspace }}/packages/utils/esm
5050
5151
BUILD_CACHE_KEY: build-cache-${{ github.event.inputs.commit || github.sha }}
52-
BUILD_PROFILING_NODE_CACHE_TARBALL_KEY: profiling-node-tarball-${{ github.event.inputs.commit || github.sha }}
52+
BUILD_CACHE_TARBALL_KEY: tarball-${{ github.event.inputs.commit || github.sha }}
5353

5454
# GH will use the first restore-key it finds that matches
5555
# So it will start by looking for one from the same branch, else take the newest one it can find elsewhere
@@ -402,15 +402,15 @@ jobs:
402402
uses: ./.github/actions/restore-cache
403403
env:
404404
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
405-
- name: Pack tarballs
406-
# Profiling tarball is built separately as we assemble the precompiled binaries
407-
run: yarn build:tarball --ignore @sentry/profiling-node
408405

409-
- name: Restore profiling tarball
410-
uses: actions/cache/restore@v4
406+
- name: Extract Profiling Node Prebuilt Binaries
407+
uses: actions/download-artifact@v3
411408
with:
412-
key: ${{ env.BUILD_PROFILING_NODE_CACHE_TARBALL_KEY }}
413-
path: ${{ github.workspace }}/packages/*/*.tgz
409+
name: profiling-node-binaries-${{ github.sha }}
410+
path: ${{ github.workspace }}/packages/profiling-node/lib/
411+
412+
- name: Pack tarballs
413+
run: yarn build:tarball
414414

415415
- name: Archive artifacts
416416
uses: actions/upload-artifact@v4
@@ -985,8 +985,6 @@ jobs:
985985
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT }}
986986
# On develop branch, we want to _store_ the cache (so it can be used by other branches), but never _restore_ from it
987987
restore-keys: ${{ env.NX_CACHE_RESTORE_KEYS }}
988-
- name: Build tarballs
989-
run: yarn build:tarball --ignore @sentry/profiling-node
990988

991989
# Rebuild profiling by compiling TS and pull the precompiled binary artifacts
992990
- name: Build Profiling Node
@@ -1001,21 +999,22 @@ jobs:
1001999
# https://github.com/actions/upload-artifact/issues/478
10021000
if: |
10031001
(needs.job_get_metadata.outputs.changed_profiling_node_bindings == 'true') ||
1002+
(needs.job_get_metadata.outputs.is_release == 'true') ||
10041003
(github.event_name != 'pull_request')
10051004
uses: actions/download-artifact@v3
10061005
with:
10071006
name: profiling-node-binaries-${{ github.sha }}
10081007
path: ${{ github.workspace }}/packages/profiling-node/lib/
10091008

10101009
- name: Build Profiling tarball
1011-
run: yarn build:tarball --scope @sentry/profiling-node
1010+
run: yarn build:tarball
10121011
# End rebuild profiling
10131012

10141013
- name: Stores tarballs in cache
10151014
uses: actions/cache/save@v4
10161015
with:
10171016
path: ${{ github.workspace }}/packages/*/*.tgz
1018-
key: ${{ env.BUILD_PROFILING_NODE_CACHE_TARBALL_KEY }}
1017+
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
10191018

10201019
job_e2e_tests:
10211020
name: E2E ${{ matrix.label || matrix.test-application }} Test
@@ -1111,7 +1110,7 @@ jobs:
11111110
uses: actions/cache/restore@v4
11121111
with:
11131112
path: ${{ github.workspace }}/packages/*/*.tgz
1114-
key: ${{ env.BUILD_PROFILING_NODE_CACHE_TARBALL_KEY }}
1113+
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
11151114

11161115
- name: Get node version
11171116
id: versions
@@ -1202,13 +1201,13 @@ jobs:
12021201
with:
12031202
name: profiling-node-binaries-${{ github.sha }}
12041203
path: ${{ github.workspace }}/packages/profiling-node/lib/
1205-
- name: Build Profiling tarball
1206-
run: yarn build:tarball --scope @sentry/profiling-node
1204+
12071205
- name: Restore tarball cache
12081206
uses: actions/cache/restore@v4
12091207
with:
12101208
path: ${{ github.workspace }}/packages/*/*.tgz
1211-
key: ${{ env.BUILD_PROFILING_NODE_CACHE_TARBALL_KEY }}
1209+
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
1210+
fail-on-cache-miss : true
12121211

12131212
- name: Get node version
12141213
id: versions

0 commit comments

Comments
 (0)