File tree Expand file tree Collapse file tree 3 files changed +19
-27
lines changed Expand file tree Collapse file tree 3 files changed +19
-27
lines changed Original file line number Diff line number Diff line change @@ -82,12 +82,16 @@ jobs:
82
82
echo "::endgroup::"
83
83
84
84
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}"
86
88
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
91
95
popd >/dev/null
92
96
echo "::endgroup::"
93
97
fi
Original file line number Diff line number Diff line change 1
1
name : release integration
2
2
3
3
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
7
10
workflow_dispatch :
8
11
inputs :
9
12
npmVersion :
12
15
required : true
13
16
14
17
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
30
18
node-integration :
31
19
name : nodejs@${{ matrix.nodeVersion }} integration
32
20
strategy :
36
24
- 18
37
25
- 19
38
26
- nightly
39
- needs :
40
- - npm-version
41
27
uses : ./.github/workflows/node-integration.yml
42
28
with :
43
29
nodeVersion : ${{ matrix.nodeVersion }}
44
- npmVersion : ${{ needs.npm-version.outputs.npmVersion }}
45
-
30
+ npmVersion : ${{ inputs.npmVersion }}
Original file line number Diff line number Diff line change
1
+ uses : ./.github/workflows/release-integration.yml
2
+ with :
3
+ npmVersion : $\{{ fromJSON(needs.release.outputs.release).version }}
You can’t perform that action at this time.
0 commit comments