mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-25 20:50:44 -06:00
Compare commits
4 commits
d23eac866f
...
00e3781049
Author | SHA1 | Date | |
---|---|---|---|
00e3781049 | |||
564a38dc85 | |||
6d21fadbf7 | |||
4f174390a8 |
6 changed files with 25 additions and 34 deletions
2
.github/actions/clean-disk/action.yml
vendored
2
.github/actions/clean-disk/action.yml
vendored
|
@ -41,7 +41,7 @@ runs:
|
||||||
sudo apt-get purge \
|
sudo apt-get purge \
|
||||||
--allow-remove-essential \
|
--allow-remove-essential \
|
||||||
-qq \
|
-qq \
|
||||||
$(non_manifest_packages) &
|
$(non_manifest_packages) > /dev/null &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wait
|
wait
|
||||||
|
|
27
.github/workflows/build.yml
vendored
27
.github/workflows/build.yml
vendored
|
@ -3,7 +3,7 @@ name: Build NixOS (on demand)
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
host:
|
hosts:
|
||||||
description: 'list of hosts to build'
|
description: 'list of hosts to build'
|
||||||
required: true
|
required: true
|
||||||
default: 'othalan algiz'
|
default: 'othalan algiz'
|
||||||
|
@ -14,15 +14,14 @@ on:
|
||||||
|
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
host:
|
hosts:
|
||||||
description: 'list of hosts to build'
|
description: 'list of hosts to build'
|
||||||
required: true
|
default: 'othalan algiz'
|
||||||
default: 'othalan aligz'
|
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
concurrency:
|
# concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
|
# group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
|
||||||
cancel-in-progress: true
|
# cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -52,10 +51,12 @@ jobs:
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
for host in ${{ inputs.host }}; do
|
for host in ${{ inputs.hosts }}; do
|
||||||
cachix watch-exec daylin -- \
|
nix run . \
|
||||||
oizys build --system-path \
|
-- \
|
||||||
--host "$host" \
|
build --system-path \
|
||||||
--flake . -- \
|
--host "$host" \
|
||||||
--print-build-logs
|
--flake . \
|
||||||
|
-- \
|
||||||
|
--print-build-logs
|
||||||
done
|
done
|
||||||
|
|
14
.github/workflows/push.yml
vendored
14
.github/workflows/push.yml
vendored
|
@ -13,20 +13,6 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# checks:
|
|
||||||
# uses: ./.github/workflows/checks.yml
|
|
||||||
# secrets: inherit
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
# needs: checks
|
|
||||||
strategy:
|
|
||||||
max-parallel: 1
|
|
||||||
matrix:
|
|
||||||
host:
|
|
||||||
- othalan
|
|
||||||
# - mannaz
|
|
||||||
# - algiz
|
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
with:
|
|
||||||
host: "${{ matrix.host }}"
|
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
|
@ -55,7 +55,7 @@ func setupLogger() {
|
||||||
log.SetReportTimestamp(false)
|
log.SetReportTimestamp(false)
|
||||||
styles := log.DefaultStyles()
|
styles := log.DefaultStyles()
|
||||||
for k, v := range styles.Levels {
|
for k, v := range styles.Levels {
|
||||||
styles.Levels[k] = v.MaxWidth(10)
|
styles.Levels[k] = v.Width(5).MaxWidth(5)
|
||||||
}
|
}
|
||||||
log.SetStyles(styles)
|
log.SetStyles(styles)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
self,
|
|
||||||
lib,
|
lib,
|
||||||
installShellFiles,
|
installShellFiles,
|
||||||
buildGoModule,
|
buildGoModule,
|
||||||
|
@ -9,11 +8,11 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib) mkDate cleanSource makeBinPath;
|
inherit (lib) cleanSource makeBinPath;
|
||||||
in
|
in
|
||||||
buildGoModule {
|
buildGoModule {
|
||||||
pname = "oizys";
|
pname = "oizys";
|
||||||
version = "${self.shortRev or "dirty"}";
|
version = "unstable";
|
||||||
|
|
||||||
src = cleanSource ./.;
|
src = cleanSource ./.;
|
||||||
vendorHash = "sha256-/JVXhXrU2np/ty7AGFy+LPZCo1NaLYl9NAyD9+FJYBI=";
|
vendorHash = "sha256-/JVXhXrU2np/ty7AGFy+LPZCo1NaLYl9NAyD9+FJYBI=";
|
||||||
|
|
|
@ -190,6 +190,7 @@ func (p *packages) summary() {
|
||||||
Render(fmt.Sprint(len(p.names))),
|
Render(fmt.Sprint(len(p.names))),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func logCmd(cmd *exec.Cmd) {
|
func logCmd(cmd *exec.Cmd) {
|
||||||
log.Debugf("CMD: %s", strings.Join(cmd.Args, " "))
|
log.Debugf("CMD: %s", strings.Join(cmd.Args, " "))
|
||||||
}
|
}
|
||||||
|
@ -237,9 +238,13 @@ func parseDryRun(buf string) (*packages, *packages) {
|
||||||
var parts [2][]string
|
var parts [2][]string
|
||||||
i := 0
|
i := 0
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
if strings.Contains(line, "fetch") {
|
if strings.Contains(line, "fetch") && strings.HasSuffix(line, ":") {
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
if i == 2 {
|
||||||
|
log.Fatal("failed to parse output", "output", buf)
|
||||||
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(line, " ") {
|
if strings.HasPrefix(line, " ") {
|
||||||
parts[i] = append(parts[i], line)
|
parts[i] = append(parts[i], line)
|
||||||
}
|
}
|
||||||
|
@ -247,7 +252,7 @@ func parseDryRun(buf string) (*packages, *packages) {
|
||||||
|
|
||||||
if len(parts[0])+len(parts[1]) == 0 {
|
if len(parts[0])+len(parts[1]) == 0 {
|
||||||
log.Info("no changes...")
|
log.Info("no changes...")
|
||||||
log.Fatal("or failed to parse nix build --dry-run output")
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
return parsePackages(parts[0], "packages to build"),
|
return parsePackages(parts[0], "packages to build"),
|
||||||
|
|
Loading…
Reference in a new issue