Fix #171, do CI fixes (#290)

* Fix defaults issue

* Check release number

* Combine CI jobs

* CI work

* Bump version

* Fix lint
This commit is contained in:
Philip Peterson 2026-05-06 03:38:30 -07:00 committed by GitHub
parent 1b01b369dc
commit c8b1770039
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 61 additions and 49 deletions

View file

@ -21,27 +21,45 @@ env:
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
jobs:
build-ubuntu:
name: Build Ubuntu
validate-tag:
name: Validate Tag Matches package.json
if: "!contains(github.ref_name, 'canary')"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Check tag matches package.json version
run: |
TAG="${{ github.ref_name }}"
ROOT_VERSION="v$(jq -r .version package.json)"
APP_VERSION="v$(jq -r .version app/package.json)"
FAILED=0
if [ "$TAG" != "$ROOT_VERSION" ]; then
echo "Error: tag '$TAG' does not match package.json version '$ROOT_VERSION'"
FAILED=1
fi
if [ "$TAG" != "$APP_VERSION" ]; then
echo "Error: tag '$TAG' does not match app/package.json version '$APP_VERSION'"
FAILED=1
fi
exit $FAILED
- name: Build
uses: ./.github/actions/build
env:
NODE_VERSION: ${{ env.NODE_VERSION }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
node-version: ${{ env.NODE_VERSION }}
matrix-os: ubuntu-latest
matrix-name: ubuntu
upload-artifact: true
build-macos:
name: Build macOS
runs-on: macos-latest
build:
name: Build ${{ matrix.name }}
needs: validate-tag
if: always() && (needs.validate-tag.result == 'success' || needs.validate-tag.result == 'skipped')
strategy:
matrix:
include:
- os: ubuntu-latest
name: Ubuntu
matrix-name: ubuntu
- os: macos-latest
name: macOS
matrix-name: macos
- os: windows-latest
name: Windows
matrix-name: win
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
@ -53,32 +71,16 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
node-version: ${{ env.NODE_VERSION }}
matrix-os: macos-latest
matrix-name: macos
upload-artifact: true
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build
uses: ./.github/actions/build
env:
NODE_VERSION: ${{ env.NODE_VERSION }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
node-version: ${{ env.NODE_VERSION }}
matrix-os: windows-latest
matrix-name: win
matrix-os: ${{ matrix.os }}
matrix-name: ${{ matrix.matrix-name }}
upload-artifact: true
# ARM Linux:
build-linux-armv7l:
name: Build Linux ARMv7l
needs: validate-tag
if: always() && (needs.validate-tag.result == 'success' || needs.validate-tag.result == 'skipped')
runs-on: ubuntu-latest
steps:
- name: Checkout code
@ -119,6 +121,8 @@ jobs:
build-linux-arm64:
name: Build Linux ARM64
needs: validate-tag
if: always() && (needs.validate-tag.result == 'success' || needs.validate-tag.result == 'skipped')
runs-on: ubuntu-latest
steps:
- name: Checkout code
@ -141,9 +145,7 @@ jobs:
upload-release:
name: Upload and Create Release
needs:
- build-ubuntu
- build-macos
- build-windows
- build
- build-linux-armv7l
- build-linux-arm64
runs-on: ubuntu-latest
@ -173,7 +175,7 @@ jobs:
gh release view "${{ github.ref_name }}" --repo "${{ github.repository }}" --json assets --jq '.assets[] | "\(.name) - \(.url)"' || true
- name: Create GitHub Release
# Pinned to work around https://github.com/softprops/action-gh-release/issues/445
# TODO Pinned to work around https://github.com/softprops/action-gh-release/issues/445
uses: softprops/action-gh-release@v3.0.0
env:
NODE_VERSION: ${{ env.NODE_VERSION }}

View file

@ -26,7 +26,9 @@ config.setup();
console.log('[main] config setup complete');
// Native
import {execFile as execFileCallback} from 'child_process';
import {resolve} from 'path';
import {promisify} from 'util';
// Packages
import {app, BrowserWindow, Menu, screen} from 'electron';
@ -107,6 +109,14 @@ async function installDevExtensions(isDev_: boolean) {
);
}
if (process.platform === 'darwin') {
const execFile = promisify(execFileCallback);
const appName = isDev ? 'com.github.Electron' : app.getName();
execFile('defaults', ['write', appName, 'ApplePressAndHoldEnabled', '-bool', 'false']).catch((err: Error) =>
console.error('defaults write failed:', err)
);
}
// eslint-disable-next-line @typescript-eslint/no-misused-promises
app.on('ready', () => {
console.log(

View file

@ -2,7 +2,7 @@
"name": "hyper",
"productName": "Hyper",
"description": "A terminal built on web technologies",
"version": "4.0.0-q-canary.11",
"version": "4.0.0-q-canary.12",
"license": "MIT",
"author": {
"name": "ZEIT, Inc.",

View file

@ -1,11 +1,11 @@
import {existsSync, readlink, symlink} from 'fs';
import path from 'path';
import {promisify} from 'util';
import type * as NativeReg from 'native-reg';
import {clipboard, dialog} from 'electron';
import {mkdirpSync} from 'fs-extra';
import type * as NativeReg from 'native-reg';
import sudoPrompt from 'sudo-prompt';
import {cliScriptPath, cliLinkPath} from '../config/paths';
@ -80,7 +80,7 @@ const addBinToUserPath = () => {
}
return new Promise<void>((resolve, reject) => {
try {
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Registry = require('native-reg') as typeof NativeReg;
const envKey = Registry.openKey(Registry.HKCU, 'Environment', Registry.Access.ALL_ACCESS)!;
@ -94,7 +94,7 @@ const addBinToUserPath = () => {
const pathItemName = pathItem || 'PATH';
let newPathValue = binPath;
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
let type = Registry.ValueType.SZ;
if (pathItem) {
type = Registry.queryValueRaw(envKey, pathItem)!.type;

View file

@ -3,7 +3,7 @@ module.exports = {
typescript: {
compile: 'tsc',
rewritePaths: {
'test/': 'dist/tmp/root/test/',
'test/': 'dist/tmp/root/test/'
}
},
verbose: true,

View file

@ -172,6 +172,6 @@ function Tab(props: TabProps) {
`}</style>
</>
);
};
}
export default Tab;

View file

@ -1,6 +1,6 @@
{
"name": "hyper-root",
"version": "4.0.0-q-canary.11",
"version": "4.0.0-q-canary.12",
"repository": "quine-global/hyper",
"engines": {
"node": "22.20.0"