Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Github Actions #165

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,36 @@ jobs:
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-latest

runs-on: ${{ matrix.os }}

steps:
- name: Set up checkout
uses: actions/checkout@v4

- name: Set up pnpm cache
uses: actions/cache@v4
- uses: pnpm/action-setup@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-node-modules-cache-
version: latest

- name: Fix pnpm bug # https://github.com/electron-userland/electron-builder/issues/6933#issuecomment-1213438889
if: matrix.os == 'windows-latest'
run: |
# Get the version of pnpm
$pnpmVersion = pnpm -v

# Construct the file path with the pnpm version
$file = "C:\Users\runneradmin\setup-pnpm\node_modules\.pnpm\pnpm@$pnpmVersion\node_modules\pnpm\bin\pnpm.cjs"

# Read the content of the file
$content = Get-Content $file

# Replace the target string
$content = $content -replace "#!/usr/bin/env node", "#!node"

# Write the modified content back to the file
$content | Set-Content $file

Write-Host "Replacement complete."

- name: Set up Electron cache
uses: actions/cache@v4
Expand All @@ -41,9 +56,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'

- name: Set up dependencies
run: pnpm install --ignore-scripts
run: pnpm install

- name: Lint
run: pnpm lint
Expand Down