-
Notifications
You must be signed in to change notification settings - Fork 2k
99 lines (90 loc) · 3.79 KB
/
experiment-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Experiment Windows Codesign
# This workflow bakes executables of the major platforms for Testing purposes
on:
merge_group:
workflow_dispatch:
push:
branches:
- develop
pull_request:
types:
- opened
- synchronize
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PR_NUMBER: ${{ github.event.number }}
jobs:
build-and-upload-artifacts:
timeout-minutes: 15
# Skip jobs for release PRs
# windows on recurring should be portable
if: ${{ !startsWith(github.head_ref, 'release/') }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: "windows-latest"
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install packages
run: npm ci
- name: Package unpacked app (Windows only)
if: matrix.os == 'windows-latest'
shell: bash
run: NODE_OPTIONS='--max_old_space_size=6144' npm run package:windows:unpacked -w insomnia
- name: Move .dll and .exe files to /tosign (PowerShell)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
New-Item -Path "packages/insomnia/dist/win-unpacked/tosign" -ItemType Directory -Force
New-Item -Path "packages/insomnia/dist/win-unpacked/signed" -ItemType Directory -Force
Get-ChildItem -Path "packages/insomnia/dist/win-unpacked" -Filter *.dll | Move-Item -Destination "packages/insomnia/dist/win-unpacked/tosign"
Get-ChildItem -Path "packages/insomnia/dist/win-unpacked" -Filter *.exe | Move-Item -Destination "packages/insomnia/dist/win-unpacked/tosign"
# signs unpacked electron-builder contents, in this case only the .exe
- name: Code-sign unpacked .exe (Windows only)
if: matrix.os == 'windows-latest'
uses: sslcom/esigner-codesign@develop
with:
command: batch_sign
username: ${{secrets.ES_USERNAME}}
password: ${{secrets.ES_PASSWORD}}
credential_id: ${{secrets.ES_CREDENTIAL_ID}}
totp_secret: ${{secrets.ES_TOTP_SECRET}}
dir_path: packages/insomnia/dist/win-unpacked/tosign
output_path: packages/insomnia/dist/win-unpacked/signed
override: true
- name: Move .dll and .exe files back to win-unpacked and delete /tosign
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Get-ChildItem -Path "packages/insomnia/dist/win-unpacked/signed" -Filter *.dll | Move-Item -Destination "packages/insomnia/dist/win-unpacked"
Get-ChildItem -Path "packages/insomnia/dist/win-unpacked/signed" -Filter *.exe | Move-Item -Destination "packages/insomnia/dist/win-unpacked"
Remove-Item -Path "packages/insomnia/dist/win-unpacked/tosign" -Recurse -Force
Remove-Item -Path "packages/insomnia/dist/win-unpacked/signed" -Recurse -Force
# re-packages the now code-signed electron-builder contents into a squirrel installer
- name: Package dist app (Windows only)
if: matrix.os == 'windows-latest'
shell: bash
run: NODE_OPTIONS='--max_old_space_size=6144' npm run package:windows:dist -w insomnia
env:
USERNAME: ${{secrets.ES_USERNAME}}
PASSWORD: ${{secrets.ES_PASSWORD}}
CREDENTIAL_ID: ${{secrets.ES_CREDENTIAL_ID}}
TOTP_SECRET: ${{secrets.ES_TOTP_SECRET}}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: ignore
name: ${{ matrix.os }}-artifacts-${{ github.run_number }}
path: |
packages/insomnia/dist/*.exe