Skip to content

Commit

Permalink
Add fallback to gpg
Browse files Browse the repository at this point in the history
  • Loading branch information
zZHorizonZz committed Sep 4, 2024
1 parent c77f154 commit 880fca8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/build-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
version: [ 22.7.0 ]
matrix:
version: [ "22.8.0" ]
variant: [ "windows-2019" ]

steps:
Expand All @@ -43,23 +43,23 @@ jobs:
- name: Test for node version
shell: pwsh
run: |
$image_node_version = (docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} node --print "process.versions.node").Trim()
$image_node_version = (docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} node --print "process.versions.node").Trim()
Write-Host "Expected: '${{ matrix.version }}', Got: '$image_node_version'"
if ($image_node_version -ne "${{ matrix.version }}") {
exit 1
exit 1
}
- name: Verify entrypoint runs regular, non-executable files with node
shell: pwsh
run: |
$tempDir = New-Item -ItemType Directory -Path $env:TEMP -Name "tempNodeApp"
$tempDir = New-Item -ItemType Directory -Path $env:TEMP -Name "tempNodeApp"
$tmp_file = Join-Path $tempDir "index.js"
"console.log('success')" | Out-File -FilePath $tmp_file -Encoding utf8
$output = (docker run --rm -w /app --mount "type=bind,src=$tempDir,target=c:\app" node:${{ matrix.version }}-${{ matrix.variant }} C:/app/index.js)
if ($output -ne 'success') {
Write-Host "Invalid"
}
- name: Test for npm
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} npm --version

Expand All @@ -69,8 +69,8 @@ jobs:
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
version: [ "22.7.0" ]
matrix:
version: [ "22.8.0" ]
variant: [ "windows-2022" ]

steps:
Expand All @@ -92,22 +92,22 @@ jobs:
- name: Test for node version
shell: pwsh
run: |
$image_node_version = (docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} node --print "process.versions.node").Trim()
$image_node_version = (docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} node --print "process.versions.node").Trim()
Write-Host "Expected: '${{ matrix.version }}', Got: '$image_node_version'"
if ($image_node_version -ne "${{ matrix.version }}") {
exit 1
}
- name: Verify entrypoint runs regular, non-executable files with node
shell: pwsh
run: |
$tempDir = New-Item -ItemType Directory -Path $env:TEMP -Name "tempNodeApp"
$tempDir = New-Item -ItemType Directory -Path $env:TEMP -Name "tempNodeApp"
$tmp_file = Join-Path $tempDir "index.js"
"console.log('success')" | Out-File -FilePath $tmp_file -Encoding utf8
$output = (docker run --rm -w /app --mount "type=bind,src=$tempDir,target=c:\app" node:${{ matrix.version }}-${{ matrix.variant }} C:/app/index.js)
if ($output -ne 'success') {
Write-Host "Invalid"
}
- name: Test for npm
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} npm --version
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} npm --version
5 changes: 4 additions & 1 deletion 22/windows-2019/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ RUN @( \
'A363A499291CBBC940DD62E41F10027AF002F8B0', \
'CC68F5A3106FF448322E48ED27F5E38D5B0A215F' \
) | foreach { \
gpg --keyserver hkps://keys.openpgp.org --recv-keys $_ ; \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $_ ; \
if (-not $?) { \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys $_ ; \
} \
} ; \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
Expand Down
5 changes: 4 additions & 1 deletion 22/windows-2022/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ RUN @( \
'A363A499291CBBC940DD62E41F10027AF002F8B0', \
'CC68F5A3106FF448322E48ED27F5E38D5B0A215F' \
) | foreach { \
gpg --keyserver hkps://keys.openpgp.org --recv-keys $_ ; \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $_ ; \
if (-not $?) { \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys $_ ; \
} \
} ; \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile-windows.template
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ RUN Invoke-WebRequest $('https://www.gnupg.org/ftp/gcrypt/binary/gnupg-w32-{0}.e
RUN @( \
"${NODE_KEYS[@]}"
) | foreach { \
gpg --keyserver hkps://keys.openpgp.org --recv-keys $_ ; \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $_ ; \
if (-not $?) { \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys $_ ; \
} \
} ; \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
Expand Down

0 comments on commit 880fca8

Please sign in to comment.