Skip to content

Commit

Permalink
refactor: ghjk envs cook
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohe-Am committed Apr 30, 2024
1 parent 2e8bbf0 commit a94fedd
Show file tree
Hide file tree
Showing 8 changed files with 387 additions and 1,253 deletions.
736 changes: 0 additions & 736 deletions .ghjk/deno.lock

This file was deleted.

867 changes: 368 additions & 499 deletions .ghjk/lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Continuous Integration

env:
GHJK_VERSION: 6d01aaa
GHJK_VERSION: 6a00967

on:
pull_request:
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ steps:
| `version` | `Ghjk version/ref to use`. | `GHJK_VERSION` or latest GitHub release from ghjk repository. |
| `skip-deno-install` | Avoid installing separate deno and use what's found in environment. | `false` |
| `installer-url` | Installer script to use. | `https://raw.github.com/metatypedev/ghjk/${version}/install.ts` |
| `sync` | Weather or not to run `ghjk ports sync`. | `true` |
| `cook` | Weather or not to run `ghjk envs cook`. | `true` |
| `cache-disable` | Disable caching `$GHJK_DIR/envs`. | `false` |
| `cache-save-if` | Weather or not to enable cache saving. Doesn't affect cache restore step. | `true` |
| `cache-key-prefix` | Override to add more target entropy to the cache key. | `v0-ghjk` |
| `cache-key-env-vars:` | Comma separated list of prefixes to match env var names to. Matches will be hashed into cache key. | "", GHJK and DENO are included by always. |

| Env vars | Desc | Default |
| -------------------------- | -------------------------------------------------------------------------------------------- | ------------------------- |
| `GHJK_DIR` | Root directory for ghjk installation and envs. | `$HOME/.local/share/ghjk` |
| `GHJK_INSTALL_EXE_DIR` | Location to install the `ghjk` exec. | `$HOME/.local/bin` |
| `GHJK_INSTALL_DENO_EXEC` | Alternative deno exec to use. This will not affect weather or not deno is installed as well. | `"deno"` |
| `GHJK_INSTALL_HOOK_SHELLS` | Comma separated list of shells to hook. | `bash` |
| `GHJK_INSTALL_HOOK_MARKER` | Marker to use when installing shell hooks. Hardly relevant in actions. | `ghjk-hook-marker` |
| `GHJK_INSTALL_NO_LOCKFILE` | Hardcode `--no-lock` into the ghjk exec. | `false` |
| Env vars | Desc | Default |
| -------------------------- | -------------------------------------------------------------------------------------------- | -------------------------- |
| `GHJK_ENV` | The environment that'll bee cooked if `cook` is enabled. | Default env from ghjkfile. |
| `GHJK_DIR` | Root directory for ghjk installation and envs. | `$HOME/.local/share/ghjk` |
| `GHJK_INSTALL_EXE_DIR` | Location to install the `ghjk` exec. | `$HOME/.local/bin` |
| `GHJK_INSTALL_DENO_EXEC` | Alternative deno exec to use. This will not affect weather or not deno is installed as well. | `"deno"` |
| `GHJK_INSTALL_HOOK_SHELLS` | Comma separated list of shells to hook. | `bash` |
| `GHJK_INSTALL_HOOK_MARKER` | Marker to use when installing shell hooks. Hardly relevant in actions. | `ghjk-hook-marker` |
| `GHJK_INSTALL_NO_LOCKFILE` | Hardcode `--no-lock` into the ghjk exec. | `false` |
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Ghjk everything'
description: 'Installs ghjk, syncs ports, cache ghjk envs'
description: 'Installs ghjk, cooks environment, cache ghjk envs'
branding:
icon: 'box'
color: 'blue'
Expand All @@ -15,8 +15,8 @@ inputs:
installer-url:
description: 'Alternative installer script to use'
required: false
sync:
description: 'Disable to skip syncing ports'
cook:
description: 'Disable to skip cooking the active environment.'
required: true
default: true
cache-disable:
Expand Down
6 changes: 3 additions & 3 deletions ghjk.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export { ghjk } from "https://raw.github.com/metatypedev/ghjk/6d01aaa/mod.ts";
export { ghjk } from "https://raw.github.com/metatypedev/ghjk/6a00967/mod.ts";
import {
$,
install,
} from "https://raw.github.com/metatypedev/ghjk/6d01aaa/mod.ts";
import * as ports from "https://raw.github.com/metatypedev/ghjk/6d01aaa/ports/mod.ts";
} from "https://raw.github.com/metatypedev/ghjk/6a00967/mod.ts";
import * as ports from "https://raw.github.com/metatypedev/ghjk/6a00967/ports/mod.ts";

install(
ports.node({
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81797,7 +81797,7 @@ async function main() {
}
}
if (inputSync === 'true') {
await exec.exec('ghjk', ['ports', 'sync']);
await exec.exec('ghjk', ['envs', 'cook']);
}
core.exportVariable('BASH_ENV', `${shareDir}/env.bash`);
core.exportVariable('GHJK_SHARE_DIR', shareDir);
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export async function main(): Promise<void> {
}

if (inputSync === 'true') {
await exec.exec('ghjk', ['ports', 'sync'])
await exec.exec('ghjk', ['envs', 'cook'])
}

core.exportVariable('BASH_ENV', `${shareDir}/env.bash`)
Expand Down

0 comments on commit a94fedd

Please sign in to comment.