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

chore: split packaging for windows builds [INS-3983] #7838

Merged
merged 6 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
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
48 changes: 43 additions & 5 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ jobs:
- name: Install packages
run: npm ci

- name: Setup Inso CLI version env var
run: |
echo "INSO_VERSION=$(jq .version ./packages/${{ env.INSO_PACKAGE_NAME }}/package.json -rj)" >> $GITHUB_ENV

# If this step fails its possible apple has new license terms which need to be accepted by logging into https://developer.apple.com/account
- name: Package app (MacOS only)
if: matrix.os == 'macos-13'
Expand All @@ -78,16 +82,50 @@ jobs:
CSC_LINK: ${{ matrix.csc_link_secret != '' && secrets[matrix.csc_link_secret] || '' }}
CSC_KEY_PASSWORD: ${{ matrix.csc_key_password_secret != '' && secrets[matrix.csc_key_password_secret] || '' }}

- name: Package app (Windows and Linux)
if: matrix.os != 'macos-13'
- name: Package app (Linux only)
if: matrix.os == 'ubuntu-latest'
shell: bash
run: npm run app-package
env:
NODE_OPTIONS: '--max_old_space_size=6144'

- name: Setup Inso CLI version env var
run:
echo "INSO_VERSION=$(jq .version ./packages/${{ env.INSO_PACKAGE_NAME }}/package.json -rj)" >> $GITHUB_ENV
# creates unpacked electron-builder contents that can be signed afterwards
- 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

# 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: sign
username: ${{secrets.ES_USERNAME}}
password: ${{secrets.ES_PASSWORD}}
credential_id: ${{secrets.ES_CREDENTIAL_ID}}
totp_secret: ${{secrets.ES_TOTP_SECRET}}
file_path: packages/insomnia/dist/win-unpacked/Insomnia.exe
override: true

# 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

# code-signs the windows installer
- name: Code-sign Windows Installer artifact (Windows only)
if: matrix.os == 'windows-latest'
uses: sslcom/esigner-codesign@develop
with:
command: sign
username: ${{secrets.ES_USERNAME}}
password: ${{secrets.ES_PASSWORD}}
credential_id: ${{secrets.ES_CREDENTIAL_ID}}
totp_secret: ${{secrets.ES_TOTP_SECRET}}
file_path: packages/insomnia/dist/squirrel-windows/Insomnia.Core-${{ env.INSO_VERSION }}.exe
override: true

- name: Package inso
run: |
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ jobs:
with:
path: ${{ env.ELECTRON_ARTIFACT_BASE64_FILE }}

- name: Code-sign Windows .exe artifact
uses: sslcom/esigner-codesign@develop
with:
command: sign
username: ${{secrets.ES_USERNAME}}
password: ${{secrets.ES_PASSWORD}}
credential_id: ${{secrets.ES_CREDENTIAL_ID}}
totp_secret: ${{secrets.ES_TOTP_SECRET}}
file_path: ${GITHUB_WORKSPACE}/artifacts/windows-latest-artifacts/insomnia/dist/squirrel-windows/Insomnia.Core-${{ env.RELEASE_VERSION }}.exe
override: true

- name: Create Tag and Release
uses: ncipollo/release-action@v1
id: core_tag_and_release
Expand Down
2 changes: 2 additions & 0 deletions packages/insomnia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"build:main.min.js": "cross-env NODE_ENV=development esr esbuild.main.ts",
"lint": "eslint . --ext .js,.ts,.tsx --cache",
"package": "npm run build:app && cross-env USE_HARD_LINKS=false electron-builder build --config electron-builder.config.js",
"package:windows:unpacked": "npm run build:app && cross-env USE_HARD_LINKS=false electron-builder build --config electron-builder.config.js --dir",
"package:windows:dist": "cross-env USE_HARD_LINKS=false electron-builder build --config electron-builder.config.js --prepackaged ./dist/win-unpacked",
"start": "concurrently -n browser,main --kill-others \"npm run start:dev-server\" \"npm run start:electron\"",
"start:dev-server": "vite dev",
"start:electron": "cross-env NODE_ENV=development esr esbuild.main.ts && electron --inspect=5858 .",
Expand Down
Loading