Skip to content

Commit 53bbc14

Browse files
nlfwraithgar
authored andcommitted
chore(release): call release-integration workflow from release
1 parent b74f834 commit 53bbc14

File tree

3 files changed

+19
-27
lines changed

3 files changed

+19
-27
lines changed

.github/workflows/node-integration.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,16 @@ jobs:
8282
echo "::endgroup::"
8383
8484
if [[ "${{ inputs.npmVersion }}" != "git" ]]; then
85-
echo "::group::checking out npm@${{ inputs.npmVersion }}"
85+
npmVersion="${{ inputs.npmVersion }}"
86+
npmVersion="${npmVersion#v}"
87+
echo "::group::checking out npm@${npmVersion}"
8688
pushd "$npmDir" >/dev/null
87-
npmVersion=$(curl -sSL https://registry.npmjs.org/npm |\
88-
jq -r '.time | to_entries | map(select(.key | test("^${{ inputs.npmVersion }}"))) | sort_by(.value | split(".") | "\(.[0])Z" | fromdate) | .[-1].key')
89-
npmGitHead=$(git show-ref --tags "v${npmVersion}" | cut -d' ' -f1)
90-
git reset --hard "$npmGitHead"
89+
taggedSha=$(git show-ref --tags "v${npmVersion}" | cut -d' ' -f1)
90+
git reset --hard "$taggedSha"
91+
publishedSha=$(curl -sSL https://registry.npmjs.org/npm | jq -r --arg ver "$npmVersion" '.versions[$ver].gitHead')
92+
if [[ "$taggedSha" != "$publishedSha" ]]; then
93+
echo "::warning ::git tag ($taggedSha) differs from published tag ($publishedSha)"
94+
fi
9195
popd >/dev/null
9296
echo "::endgroup::"
9397
fi
Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: release integration
22

33
on:
4-
release:
5-
types:
6-
- published
4+
workflow_call:
5+
inputs:
6+
npmVersion:
7+
description: npm version to test
8+
type: string
9+
required: true
710
workflow_dispatch:
811
inputs:
912
npmVersion:
@@ -12,21 +15,6 @@ on:
1215
required: true
1316

1417
jobs:
15-
npm-version:
16-
env:
17-
npmVersion: ${{ inputs.npmVersion || github.ref_name }}
18-
name: determine npm version
19-
if: ${{ inputs.npmVersion || startsWith(github.ref_name, 'v') }}
20-
runs-on: ubuntu-latest
21-
outputs:
22-
npmVersion: ${{ steps.version.outputs.npmVersion }}
23-
steps:
24-
- name: clean npm version
25-
id: version
26-
run: |
27-
npmVersion="${{ env.npmVersion }}"
28-
npmVersion="${npmVersion/#v}"
29-
echo "npmVersion=${npmVersion}" >> $GITHUB_OUTPUT
3018
node-integration:
3119
name: nodejs@${{ matrix.nodeVersion }} integration
3220
strategy:
@@ -36,10 +24,7 @@ jobs:
3624
- 18
3725
- 19
3826
- nightly
39-
needs:
40-
- npm-version
4127
uses: ./.github/workflows/node-integration.yml
4228
with:
4329
nodeVersion: ${{ matrix.nodeVersion }}
44-
npmVersion: ${{ needs.npm-version.outputs.npmVersion }}
45-
30+
npmVersion: ${{ inputs.npmVersion }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
uses: ./.github/workflows/release-integration.yml
2+
with:
3+
npmVersion: $\{{ fromJSON(needs.release.outputs.release).version }}

0 commit comments

Comments
 (0)