Skip to content

Commit ee8af3e

Browse files
authored
update to Node.js 24.18.1 and setup trusted publishing (#8291)
1 parent 314d777 commit ee8af3e

30 files changed

Lines changed: 348 additions & 289 deletions

.changeset/odd-weeks-trade.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'hive': patch
3+
---
4+
5+
Update to Node.js `24.18.1`.

.changeset/upset-lizards-tie.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@graphql-hive/apollo': patch
3+
'@graphql-hive/cli': patch
4+
'@graphql-hive/core': patch
5+
'@graphql-hive/envelop': patch
6+
'@graphql-hive/external-composition': patch
7+
'@graphql-hive/gateway-plugin-console-sdk': patch
8+
'@graphql-hive/laboratory': patch
9+
'@graphql-hive/render-laboratory': patch
10+
'@graphql-hive/yoga': patch
11+
---
12+
13+
Use npm trusted publishing.

.github/actions/setup/action.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,17 @@ runs:
2828
env:
2929
INSTALL_DEPENDENCIES: ${{ inputs.installDependencies }}
3030
run: |
31-
PNPM_VERSION=$(cat package.json | jq -r '.packageManager' | awk -F@ '{print $2}')
32-
PNPM_VERSION=${PNPM_VERSION:-9}
33-
echo "Using PNPM version $PNPM_VERSION"
34-
echo "version=$PNPM_VERSION" >> $GITHUB_OUTPUT
35-
3631
if [ $INSTALL_DEPENDENCIES = true ]; then
3732
echo "cache=pnpm" >> $GITHUB_OUTPUT
3833
else
3934
echo "cache=" >> $GITHUB_OUTPUT
4035
fi
4136
4237
- name: install pnpm
43-
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
44-
with:
45-
version: ${{ steps.pnpm.outputs.version }}
38+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
4639

4740
- name: install nodejs
48-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
41+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
4942
with:
5043
node-version-file: .node-version
5144
cache: ${{ steps.pnpm.outputs.cache }}

.github/workflows/build-and-dockerize.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ jobs:
175175
echo "sha_short=${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT
176176
fi
177177
178+
- name: configure Docker Node.js image tag
179+
id: node-version-tag
180+
if: ${{ inputs.dockerize }}
181+
run: echo "value=:$(< .node-version)-slim" >> "$GITHUB_OUTPUT"
182+
178183
- name: build docker images (${{ matrix.platform }})
179184
timeout-minutes: 60
180185
id: docker-bake
@@ -191,6 +196,7 @@ jobs:
191196
BUILD_STABLE: ${{ inputs.publishLatest && '1' || '' }}
192197
BUILD_PLATFORM: ${{ matrix.platform }}
193198
IMAGE_SUFFIX: ${{ matrix.suffix }}
199+
NODE_VERSION_TAG: ${{ steps.node-version-tag.outputs.value }}
194200
with:
195201
# See https://github.com/docker/buildx/issues/1533
196202
provenance: false
@@ -237,6 +243,10 @@ jobs:
237243
with:
238244
fetch-depth: 2
239245

246+
- name: configure Docker Node.js image tag
247+
id: node-version-tag
248+
run: echo "value=:$(< .node-version)-slim" >> "$GITHUB_OUTPUT"
249+
240250
- name: configure docker buildx
241251
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
242252

@@ -254,6 +264,7 @@ jobs:
254264
REGISTRY: ${{ inputs.registry }}
255265
IMAGE_NAME: ${{ inputs.imageName }}
256266
IMAGE_TAG: ${{ inputs.imageTag }}
267+
NODE_VERSION_TAG: ${{ steps.node-version-tag.outputs.value }}
257268
run: |
258269
targets=$(docker buildx bake -f docker/docker.hcl --print "$TARGETS" | jq -r '.group."'"$TARGETS"'".targets[]')
259270
@@ -284,6 +295,7 @@ jobs:
284295
REGISTRY: ${{ inputs.registry }}
285296
IMAGE_NAME: ${{ inputs.imageName }}
286297
IMAGE_TAG: ${{ steps.git_hash.outputs.sha_short }}
298+
NODE_VERSION_TAG: ${{ steps.node-version-tag.outputs.value }}
287299
run: |
288300
targets=$(docker buildx bake -f docker/docker.hcl --print "$TARGETS" | jq -r '.group."'"$TARGETS"'".targets[]')
289301
@@ -308,6 +320,7 @@ jobs:
308320
SHA_SHORT: ${{ steps.git_hash.outputs.sha_short }}
309321
RELEASE_STAGE: ${{ inputs.publishLatest == false && 'alpha-' || '' }}
310322
LATEST_VERSION: ${{ inputs.latestVersion }}
323+
NODE_VERSION_TAG: ${{ steps.node-version-tag.outputs.value }}
311324
run: |
312325
targets=$(docker buildx bake -f docker/docker.hcl --print "$TARGETS" | jq -r '.group."'"$TARGETS"'".targets[]')
313326
@@ -328,6 +341,7 @@ jobs:
328341
TARGETS: ${{ inputs.targets }}
329342
REGISTRY: ${{ inputs.registry }}
330343
IMAGE_NAME: ${{ inputs.imageName }}
344+
NODE_VERSION_TAG: ${{ steps.node-version-tag.outputs.value }}
331345
run: |
332346
targets=$(docker buildx bake -f docker/docker.hcl --print "$TARGETS" | jq -r '.group."'"$TARGETS"'".targets[]')
333347

.github/workflows/dockerize-cli.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2828
with:
2929
fetch-depth: 2
30+
- name: configure Docker Node.js image tag
31+
id: node-version-tag
32+
run: echo "value=:$(< .node-version)-slim" >> "$GITHUB_OUTPUT"
3033
- name: configure eqemu
3134
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
3235
with:
@@ -42,6 +45,8 @@ jobs:
4245

4346
- name: Prepare Bake inputs
4447
id: docker-bake-inputs
48+
env:
49+
NODE_VERSION_TAG: ${{ steps.node-version-tag.outputs.value }}
4550
run: |
4651
targets=$(docker buildx bake -f docker/docker.hcl --print build | jq -r '.group.build.targets[]')
4752
input_set=""
@@ -68,6 +73,7 @@ jobs:
6873
BUILD_TYPE: 'publish'
6974
PWD: ${{ github.workspace }}
7075
BUILD_STABLE: ${{ inputs.publishLatest && '1' || '' }}
76+
NODE_VERSION_TAG: ${{ steps.node-version-tag.outputs.value }}
7177
with:
7278
# See https://github.com/docker/buildx/issues/1533
7379
provenance: false

.github/workflows/main.yaml

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -9,73 +9,6 @@ concurrency:
99
cancel-in-progress: false
1010

1111
jobs:
12-
# Release NPM packages and tarballs
13-
package:
14-
uses: ./.github/workflows/release-stable.yaml
15-
secrets: inherit
16-
17-
changeset-version:
18-
needs:
19-
- package
20-
if: ${{ needs.package.outputs.hivePublish != 'true' }}
21-
uses: ./.github/workflows/changeset-version.yaml
22-
23-
# Build all packages and applications, and creates Docker images.
24-
build:
25-
needs:
26-
- package
27-
- changeset-version
28-
uses: ./.github/workflows/build-and-dockerize.yaml
29-
with:
30-
imageTag:
31-
# prettier-ignore
32-
${{ needs.package.outputs.hivePublish == 'true' && needs.package.outputs.hiveVersion || github.sha }}
33-
publishSourceMaps: true
34-
publishLatest: ${{ needs.package.outputs.hivePublish == 'true' }}
35-
targets: build
36-
uploadJavaScriptArtifacts: true
37-
latestVersion:
38-
${{ needs.package.outputs.hivePublish == 'true' && needs.package.outputs.hiveVersion ||
39-
needs.changeset-version.outputs.version }}
40-
secrets: inherit
41-
42-
# Dockerize the CLI in case a CLI version was released
43-
publish_docker_cli:
44-
needs:
45-
- package
46-
uses: ./.github/workflows/dockerize-cli.yaml
47-
if: ${{ needs.package.outputs.cliPublish == 'true' }}
48-
with:
49-
cliVersion: ${{ needs.package.outputs.cliVersion }}
50-
publishLatest: true
51-
secrets: inherit
52-
53-
# Trigger deployment for staging
54-
deploy:
55-
name: trigger staging deployment
56-
needs:
57-
- build
58-
runs-on: ubuntu-22.04
59-
if: ${{ vars.ENABLE_STAGING_DEPLOYMENT == '1' }}
60-
steps:
61-
- name: Dispatch Deployment
62-
run: |
63-
curl --request POST \
64-
--url 'https://api.github.com/repos/${{ secrets.PRIVATE_REPO_OWNER }}/${{ secrets.PRIVATE_REPO_NAME }}/dispatches' \
65-
--header 'Accept: application/vnd.github+json' \
66-
--header 'Authorization: Bearer ${{ secrets.GH_PAT }}' \
67-
--header 'X-GitHub-Api-Version: 2022-11-28' \
68-
--header 'Content-Type: application/json' \
69-
--data '{
70-
"event_type": "deploy-staging",
71-
"client_payload": {
72-
"actor": "${{ github.actor }}",
73-
"ref": "${{ github.sha }}",
74-
"pulumiRefresh": "true",
75-
"hiveAppUsePersistedDocuments": "true"
76-
}
77-
}'
78-
7912
# ESLint and Prettier
8013
code-style:
8114
uses: ./.github/workflows/lint.yaml

.github/workflows/pr.yaml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,8 @@ jobs:
8383
typescript:
8484
uses: ./.github/workflows/typescript-typecheck.yaml
8585

86-
# Release alpha version on NPM for Hive libraries
86+
# Build and test standalone CLI artifacts
8787
alpha:
8888
uses: ./.github/workflows/release-alpha.yaml
8989
if: ${{ github.event.pull_request.title != 'Upcoming Release Changes' }}
9090
secrets: inherit
91-
92-
# Release RC version on NPM for Hive libraries
93-
release-candidate:
94-
uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@main
95-
if: ${{ github.event.pull_request.title == 'Upcoming Release Changes' }}
96-
with:
97-
npmTag: rc
98-
restoreDeletedChangesets: true
99-
buildScript: build:libraries
100-
packageManager: pnpm
101-
nodeVersion: '24.18'
102-
secrets:
103-
githubToken: ${{ secrets.GITHUB_TOKEN }}
104-
npmToken: ${{ secrets.NPM_TOKEN }}

.github/workflows/release-alpha.yaml

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,6 @@ on:
22
workflow_call:
33

44
jobs:
5-
# Release alpha version on NPM for Hive libraries
6-
npm:
7-
uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@main
8-
permissions:
9-
pull-requests: write
10-
actions: write
11-
contents: write
12-
with:
13-
npmTag: alpha
14-
buildScript: build:libraries
15-
packageManager: pnpm
16-
nodeVersion: '24.18'
17-
secrets:
18-
githubToken: ${{ secrets.GITHUB_TOKEN }}
19-
npmToken: ${{ secrets.NPM_TOKEN }}
20-
215
# Upload zipped tarballs to GitHub
226
cli-artifacts:
237
runs-on: ubuntu-22.04
@@ -105,31 +89,3 @@ jobs:
10589
tar -xzf *.tar.gz
10690
# Expect the command to succeed
10791
./hive/bin/hive --version || exit 1
108-
109-
extract-cli-version:
110-
needs: [npm]
111-
runs-on: ubuntu-22.04
112-
name: Extract CLI version
113-
outputs:
114-
published: ${{ steps.cli.outputs.published }}
115-
version: ${{ steps.cli.outputs.version }}
116-
steps:
117-
- name: Extract published version
118-
if:
119-
needs.npm.outputs.published && contains(needs.npm.outputs.publishedPackages,
120-
'"@graphql-hive/cli"')
121-
id: cli
122-
run: |
123-
echo '${{needs.npm.outputs.publishedPackages}}' > cli-ver.json
124-
VERSION=`echo $(jq -r '.[] | select(.name | endswith("@graphql-hive/cli")).version' cli-ver.json)`
125-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
126-
echo "published=true" >> "$GITHUB_OUTPUT"
127-
128-
publish_docker:
129-
needs: [extract-cli-version]
130-
uses: ./.github/workflows/dockerize-cli.yaml
131-
if: ${{ needs.extract-cli-version.outputs.published == 'true' }}
132-
with:
133-
cliVersion: ${{ needs.extract-cli-version.outputs.version }}
134-
publishLatest: false
135-
secrets: inherit

0 commit comments

Comments
 (0)