Skip to content

ci: add retry logic to npm audit steps for transient npm registry 504… #8

ci: add retry logic to npm audit steps for transient npm registry 504…

ci: add retry logic to npm audit steps for transient npm registry 504… #8

name: Electron + Go Desktop
on:
workflow_dispatch:
pull_request:
paths:
- "electron-desktop/**"
- ".github/workflows/electron-go-release.yml"
push:
branches:
- main
tags:
- "v*.*.*"
permissions:
contents: read
jobs:
test:
name: Test Electron + Go
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: electron-desktop
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "24"
cache: npm
cache-dependency-path: electron-desktop/package-lock.json
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version-file: electron-desktop/backend-go/go.mod
cache-dependency-path: electron-desktop/backend-go/go.sum
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
npm ci
python -m pip install -e ..
- name: Run Node and Go tests
run: |
npm test
npm run test:go
- name: Build and smoke-test the Go worker
run: |
npm run build:go
npm run smoke:worker
- name: Compare the Go and classic Python engines
run: npm run test:parity:legacy
- name: Prepare the private Chromium runtime
run: npm run prepare:browser
- name: Run Electron end-to-end tests
run: xvfb-run --auto-servernum npm run test:e2e
- name: Run the authorization benchmark
timeout-minutes: 15
run: xvfb-run --auto-servernum npm run test:authorization-benchmark
package:
name: Package ${{ matrix.label }}
needs: test
strategy:
fail-fast: false
matrix:
include:
- label: Windows
os: windows-latest
command: dist:win
- label: Linux
os: ubuntu-latest
command: dist:linux
- label: macOS
os: macos-latest
command: dist:mac
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: electron-desktop
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "24"
cache: npm
cache-dependency-path: electron-desktop/package-lock.json
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version-file: electron-desktop/backend-go/go.mod
cache-dependency-path: electron-desktop/backend-go/go.sum
- name: Install dependencies
run: npm ci
- name: Build platform packages
run: npm run ${{ matrix.command }}
- name: Verify packaged worker, browser and installers
run: npm run test:artifacts
- name: Generate platform release metadata
run: npm run release:notes
- name: Verify Windows install, upgrade and uninstall
if: runner.os == 'Windows'
run: npm run test:lifecycle:win
- name: Upload platform packages
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: WSHawk-Electron-Go-${{ runner.os }}-packages
if-no-files-found: error
path: |
electron-desktop/dist-electron-go/*.exe
electron-desktop/dist-electron-go/*.AppImage
electron-desktop/dist-electron-go/*.deb
electron-desktop/dist-electron-go/*.tar.gz
electron-desktop/dist-electron-go/*.dmg
electron-desktop/dist-electron-go/*.zip
electron-desktop/dist-electron-go/ELECTRON-GO-RELEASE-NOTES.md
electron-desktop/dist-electron-go/SHA256SUMS.json
release:
name: Publish Electron + Go release
if: startsWith(github.ref, 'refs/tags/v')
needs: package
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "24"
- name: Download platform packages
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
path: release-artifacts
- name: Assemble checksums and release notes
run: |
node electron-desktop/scripts/assemble-release.js \
--artifacts release-artifacts \
--output release-output \
--tag "$GITHUB_REF_NAME" \
--repository "$GITHUB_REPOSITORY"
cat release-output/release-notes.md >> "$GITHUB_STEP_SUMMARY"
- name: Publish Electron + Go release
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
with:
tag_name: electron-go-${{ github.ref_name }}
target_commitish: ${{ github.sha }}
name: WSHawk Electron + Go ${{ github.ref_name }}
body_path: release-output/release-notes.md
generate_release_notes: true
draft: false
prerelease: false
fail_on_unmatched_files: true
files: |
release-artifacts/**/*.exe
release-artifacts/**/*.AppImage
release-artifacts/**/*.deb
release-artifacts/**/*.tar.gz
release-artifacts/**/*.dmg
release-artifacts/**/*.zip
release-output/SHA256SUMS-ELECTRON-GO.txt