Skip to content

Commit 6f2e94a

Browse files
Rewrite setup scripts for simpler code and more explicit commands
1 parent 2294a41 commit 6f2e94a

48 files changed

Lines changed: 496 additions & 4363 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.initiat/setup.yml

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,46 @@ defaults:
1313
cwd: "."
1414

1515
bootstrap:
16-
- name: "Ensure package manager"
17-
ensure_package_manager:
18-
type: auto
19-
20-
- name: "Ensure Git is installed"
21-
ensure_tool:
22-
name: git
23-
install:
24-
brew:
25-
formula: git
26-
apt:
27-
packages: [git]
28-
update: true
29-
choco:
30-
packages: [git]
16+
- name: "Install Homebrew (macOS)"
17+
if: os("macos") && !cmd_ok("command -v brew")
18+
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
19+
20+
- name: "Update apt (Linux)"
21+
if: os("linux")
22+
run: sudo apt-get update
23+
24+
- name: "Install Git (macOS)"
25+
if: os("macos") && !cmd_ok("command -v git")
26+
run: brew install git
27+
28+
- name: "Install Git (Linux)"
29+
if: os("linux") && !cmd_ok("command -v git")
30+
run: sudo apt-get install -y git
31+
32+
- name: "Install Git (Windows)"
33+
if: os("windows") && !cmd_ok("where git")
34+
run: choco install git -y
35+
36+
- name: "Install asdf (macOS/Linux)"
37+
if: '!os("windows") && !cmd_ok("command -v asdf")'
38+
run: |
39+
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0 || true
40+
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc
41+
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.zshrc || true
42+
. "$HOME/.asdf/asdf.sh"
3143
3244
provision:
33-
- name: "Ensure Go runtime"
34-
ensure_runtime:
35-
name: go
36-
version: ">=1.25.3"
37-
manager:
38-
asdf: true
39-
fallback_installers:
40-
- brew:
41-
formula: go
42-
- apt:
43-
packages: [golang-go]
44-
update: true
45-
- choco:
46-
packages: [golang]
45+
- name: "Install Go via asdf"
46+
if: '!os("windows") && !cmd_ok("go --version")'
47+
run: |
48+
. "$HOME/.asdf/asdf.sh" || true
49+
asdf plugin add golang || true
50+
asdf install golang 1.25.3
51+
asdf global golang 1.25.3
52+
53+
- name: "Install Go via Chocolatey (Windows)"
54+
if: os("windows") && !cmd_ok("go --version")
55+
run: choco install golang -y
4756

4857
setup:
4958
- name: "Download Go dependencies"
@@ -53,7 +62,7 @@ setup:
5362
run: go mod verify
5463

5564
- name: "Install Linux X11 libraries for clipboard support"
56-
if: os == "linux"
65+
if: os("linux")
5766
run: |
5867
if command -v apt-get &> /dev/null; then
5968
sudo apt-get update && sudo apt-get install -y libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
@@ -67,20 +76,20 @@ setup:
6776
6877
verify:
6978
- name: "Verify Go version"
70-
assert_command: go version
79+
run: go version || exit 1
7180

7281
- name: "Verify Go modules are available"
73-
assert_command: go list -m all
82+
run: go list -m all || exit 1
7483

7584
- name: "Build the project"
7685
run: go build -o initiat .
7786

7887
- name: "Verify binary was created (Unix)"
79-
if: os == "macos" || os == "linux"
88+
if: '!os("windows")'
8089
run: test -f initiat && echo "Binary created successfully"
8190

8291
- name: "Verify binary was created (Windows)"
83-
if: os == "windows"
92+
if: os("windows")
8493
run: if (Test-Path initiat.exe) { Write-Host "Binary created successfully" } else { exit 1 }
8594

8695
post:

0 commit comments

Comments
 (0)