mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 01:50:44 -06:00
Compare commits
1 commit
4c37ca0424
...
79e8348c84
Author | SHA1 | Date | |
---|---|---|---|
79e8348c84 |
7 changed files with 22 additions and 41 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
@ -41,7 +41,7 @@ jobs:
|
|||
- uses: ./.github/actions/nix
|
||||
with:
|
||||
attic_token: ${{ secrets.ATTIC_TOKEN }}
|
||||
# clean: true
|
||||
clean: true
|
||||
btrfs: true
|
||||
|
||||
- name: write lock file
|
||||
|
|
14
.github/workflows/update.yml
vendored
14
.github/workflows/update.yml
vendored
|
@ -2,13 +2,6 @@ name: Flake Update / Build
|
|||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
hosts:
|
||||
description: 'list of hosts to build'
|
||||
required: true
|
||||
default: 'othalan,algiz'
|
||||
type: string
|
||||
|
||||
schedule:
|
||||
# At minute 00:00 on Monday, Wednesday, and Friday.
|
||||
- cron: 0 0 * * 1,3,5
|
||||
|
@ -58,7 +51,7 @@ jobs:
|
|||
nix run .
|
||||
--
|
||||
cache
|
||||
--host,="${{ inputs.hosts }}"
|
||||
--host,=",othalan,algiz,mannaz,naudiz"
|
||||
--flake .
|
||||
--debug
|
||||
--
|
||||
|
@ -101,7 +94,7 @@ jobs:
|
|||
nix run .
|
||||
--
|
||||
ci update
|
||||
--host,="${{ inputs.hosts }}"
|
||||
--host,=othalan,algiz,mannaz,naudiz
|
||||
--flake .
|
||||
--debug
|
||||
--
|
||||
|
@ -109,8 +102,7 @@ jobs:
|
|||
|
||||
- run: |
|
||||
echo "# system diffs" >> $GITHUB_STEP_SUMMARY
|
||||
hosts="${{ inputs.hosts }}"
|
||||
for host in ${hosts//,/ }; do
|
||||
for host in othalan algiz mannaz naudiz; do
|
||||
echo "## $host" >> $GITHUB_STEP_SUMMARY
|
||||
nix run "nixpkgs#nvd" -- --color always diff ./$host-current ./$host-updated >> $host-summary.md
|
||||
printf '```\n%s\n```\n' "$(nix run "nixpkgs#nvd" -- diff ./$host-current ./$host-updated)" >> $GITHUB_STEP_SUMMARY
|
||||
|
|
16
flake.lock
16
flake.lock
|
@ -318,11 +318,11 @@
|
|||
"xdph": "xdph"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1732054045,
|
||||
"narHash": "sha256-/2SKmO6AWDqvhN8A8VxA244Au3LwFu7wOXzudWQXr9s=",
|
||||
"lastModified": 1731978971,
|
||||
"narHash": "sha256-P9DXCxDvjFt4aMc2x67hvSpNvSqX18X840w6cEVZXoo=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "c4eda46d0ef022a17348623beec4154ba34af691",
|
||||
"revCount": 5482,
|
||||
"rev": "67cee430061626ccd73dc6d30eed9db289053608",
|
||||
"revCount": 5480,
|
||||
"submodules": true,
|
||||
"type": "git",
|
||||
"url": "https://github.com/hyprwm/Hyprland/"
|
||||
|
@ -498,11 +498,11 @@
|
|||
"lix": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1732056932,
|
||||
"narHash": "sha256-3ubtSu0D+BUV5FKmBU7kTEXlI/okp/j1xC/ODC7LgTA=",
|
||||
"rev": "b0d7a816135de1cd551b8a54f5497148bf59d81d",
|
||||
"lastModified": 1731992627,
|
||||
"narHash": "sha256-OjrXEVD8LtZB5X7LtPCdNx4n5iZOQ2nJmpDlM/foEkI=",
|
||||
"rev": "f116608a20430b8484814300cdf22eebeb75a59f",
|
||||
"type": "tarball",
|
||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/b0d7a816135de1cd551b8a54f5497148bf59d81d.tar.gz?rev=b0d7a816135de1cd551b8a54f5497148bf59d81d"
|
||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/f116608a20430b8484814300cdf22eebeb75a59f.tar.gz?rev=f116608a20430b8484814300cdf22eebeb75a59f"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
|
|
|
@ -8,7 +8,7 @@ buildNimblePackage {
|
|||
verions = "unstable";
|
||||
src = lib.cleanSource ./.;
|
||||
nativeBuildInputs = [ openssl ];
|
||||
nimbleDepsHash = "sha256-IWdlWC+j2h15WjVXXdDyxDZsb0/Ti1+jy6RfmqHFkjs=";
|
||||
nimbleDepsHash = "sha256-1YoGvWvoJJSMauDbeH8ZHuK+QQot48Mkye9TeWteT8k=";
|
||||
|
||||
meta = {
|
||||
description = "nix begat oizys";
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
"packages": {
|
||||
"hwylterm": {
|
||||
"version": "0.1.0",
|
||||
"vcsRevision": "ef573dc0f8bf39f80704f92cfab39e1b9af82492",
|
||||
"vcsRevision": "c5f70cec4e40ba396f59162e98c359a1a1ea4fe1",
|
||||
"url": "https://github.com/daylinmorgan/hwylterm",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [],
|
||||
"checksums": {
|
||||
"sha1": "ccb51201898b5e913ffee1e18bdf4d9fc4004386"
|
||||
"sha1": "5727969a8e82e29a7581c13cc7cc45996dbca5a1"
|
||||
}
|
||||
},
|
||||
"jsony": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
## nix begat oizys
|
||||
import std/[os, osproc, sequtils, strformat, strutils, tables]
|
||||
import std/[os, osproc, sequtils, strformat, strutils]
|
||||
import hwylterm, hwylterm/[hwylcli]
|
||||
import oizys/[context, github, nix, logging]
|
||||
|
||||
|
@ -77,27 +77,17 @@ hwylCli:
|
|||
ciUpdate(args)
|
||||
|
||||
[gha]
|
||||
... """
|
||||
trigger GHA
|
||||
|
||||
examples:
|
||||
[b]oizys gha update[/] --input:hosts:othalan,algiz,mannaz
|
||||
"""
|
||||
... "trigger GHA"
|
||||
flags:
|
||||
input:
|
||||
T seq[KVString]
|
||||
? "inputs for dispatch"
|
||||
# make a key/value input that is passed to workflows and encoded in json
|
||||
# i.e. --input:ref:main
|
||||
`ref`:
|
||||
T string
|
||||
? "git ref/branch/tag to trigger workflow on"
|
||||
* "main"
|
||||
run:
|
||||
# TODO: support file operations like gh
|
||||
# i.e. @flake.lock means read a file a flake.lock and use it's contents
|
||||
if args.len == 0: fatalQuit "expected workflow file name"
|
||||
let inputs =
|
||||
input.mapIt((it.key, it.val)).toTable()
|
||||
createDispatch(args[0], `ref`, inputs)
|
||||
createDispatch(args[0], `ref`)
|
||||
|
||||
[dry]
|
||||
... "dry run build"
|
||||
|
|
|
@ -100,14 +100,13 @@ proc getInProgressRun(
|
|||
|
||||
warn "timeout reached waiting for workflow to start"
|
||||
|
||||
proc createDispatch*(workflowFileName: string, `ref`: string, inputs: Table[string, string]) =
|
||||
proc createDispatch*(workflowFileName: string, `ref`: string) =
|
||||
## https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event
|
||||
let workflow =
|
||||
if workflowFileName.endsWith(".yml") or workflowFileName.endsWith(".yaml"): workflowFileName
|
||||
else: workflowFileName & ".yml"
|
||||
let body = %*{"ref": `ref`, "inputs": inputs}
|
||||
let body = %*{"ref": `ref`}
|
||||
info fmt"creating dispatch event for {workflow}"
|
||||
debug "with body: " & $body
|
||||
postGhApi(
|
||||
fmt"https://api.github.com/repos/daylinmorgan/oizys/actions/workflows/{workflow}/dispatches",
|
||||
body
|
||||
|
|
Loading…
Reference in a new issue