Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 52 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- os: windows-latest
arch: x86_64
config: cli
- os: windows-11-arm
arch: arm64
config: cli
- os: macos-latest
arch: arm64
config: cli
Expand All @@ -32,12 +35,21 @@ jobs:
- os: ubuntu-latest
arch: x86_64
config: library
- os: ubuntu-24.04-arm
arch: arm64
config: library
- os: windows-latest
arch: x86_64
config: library
- os: windows-11-arm
arch: arm64
config: library
- os: macos-latest
arch: arm64
config: library
- os: macos-13
arch: x86_64
config: library
steps:
- uses: actions/checkout@v4
- name: Install D
Expand All @@ -47,18 +59,51 @@ jobs:
- name: Build
run: dub build --config=${{ matrix.config }} --build=release

gui-linux:
name: gui ubuntu-latest x86_64
runs-on: ubuntu-latest
# Native GUI build per OS (not cross-compile — each job links against that runner's Qt).
gui:
name: gui ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-24.04-arm
arch: arm64
- os: windows-latest
arch: x86_64
- os: macos-latest
arch: arm64
steps:
- uses: actions/checkout@v4
- name: Install Qt
run: |
sudo apt-get update
sudo apt-get install -y qt6-base-dev
- name: Install D
uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-latest
- name: Install Qt (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y qt6-base-dev
- name: Install Qt (macOS)
if: runner.os == 'macOS'
run: brew install qt
- name: Install Qt (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
python -m pip install aqtinstall
python -m aqt install-qt windows desktop 6.7.3 win64_msvc2019_64 -O "$env:RUNNER_TEMP\Qt"
$qt = Get-ChildItem "$env:RUNNER_TEMP\Qt\6.7.3" -Directory | Select-Object -First 1
"QT_ROOT=$($qt.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Append
"DFLAGS=-L/LIBPATH:$($qt.FullName)\lib" | Out-File -FilePath $env:GITHUB_ENV -Append
"PATH=$($qt.FullName)\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Qt paths (macOS)
if: runner.os == 'macOS'
run: |
echo "PATH=$(brew --prefix qt)/bin:$PATH" >> "$GITHUB_ENV"
echo "LIBRARY_PATH=$(brew --prefix qt)/lib:${LIBRARY_PATH:-}" >> "$GITHUB_ENV"
echo "CPATH=$(brew --prefix qt)/include:${CPATH:-}" >> "$GITHUB_ENV"
- name: Build GUI
run: dub build --config=gui --build=release
63 changes: 52 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
asset: ver-windows-x86_64.exe
lib: ver-windows-x86_64.lib
lib_glob: '*.lib'
- os: windows-11-arm
asset: ver-windows-arm64.exe
lib: ver-windows-arm64.lib
lib_glob: '*.lib'
- os: macos-latest
asset: ver-macos-arm64
lib: libver-macos-arm64.a
Expand Down Expand Up @@ -65,31 +69,68 @@ jobs:
${{ matrix.asset }}
${{ matrix.lib }}

gui-linux:
name: Build ver-gui-linux-x86_64
runs-on: ubuntu-latest
gui:
name: Build ${{ matrix.asset }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
asset: ver-gui-linux-x86_64
- os: ubuntu-24.04-arm
asset: ver-gui-linux-arm64
- os: windows-latest
asset: ver-gui-windows-x86_64.exe
- os: macos-latest
asset: ver-gui-macos-arm64
steps:
- uses: actions/checkout@v4
- name: Install Qt
run: |
sudo apt-get update
sudo apt-get install -y qt6-base-dev
- name: Install D
uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-latest
- name: Install Qt (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y qt6-base-dev
- name: Install Qt (macOS)
if: runner.os == 'macOS'
run: brew install qt
- name: Install Qt (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
python -m pip install aqtinstall
python -m aqt install-qt windows desktop 6.7.3 win64_msvc2019_64 -O "$env:RUNNER_TEMP\Qt"
$qt = Get-ChildItem "$env:RUNNER_TEMP\Qt\6.7.3" -Directory | Select-Object -First 1
"QT_ROOT=$($qt.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Append
"DFLAGS=-L/LIBPATH:$($qt.FullName)\lib" | Out-File -FilePath $env:GITHUB_ENV -Append
"PATH=$($qt.FullName)\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Qt paths (macOS)
if: runner.os == 'macOS'
run: |
echo "PATH=$(brew --prefix qt)/bin:$PATH" >> "$GITHUB_ENV"
echo "LIBRARY_PATH=$(brew --prefix qt)/lib:${LIBRARY_PATH:-}" >> "$GITHUB_ENV"
- name: Build GUI
run: dub build --config=gui --build=release
- name: Stage
run: mv ver-gui ver-gui-linux-x86_64
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
mv ver-gui.exe "${{ matrix.asset }}"
else
mv ver-gui "${{ matrix.asset }}"
fi
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ver-gui-linux-x86_64
path: ver-gui-linux-x86_64
name: ${{ matrix.asset }}
path: ${{ matrix.asset }}

release:
needs: [build, gui-linux]
needs: [build, gui]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ dub build --config=library --build=release
dub build --config=gui --build=release
```

As a dependency (DUB registry after first publish, or git):
As a dependency:

```json
"dependencies": {
"ver": {
"repository": "git+https://github.com/dev-centr/ver.git",
"version": "~main"
}
"ver": "~>0.2.4"
}
```

(`dqt` for the optional GUI is a **git** dependency on `dlang-supplemental/dqt`, not Dub. Qt itself is a system/aqt install.)

## Usage

```bash
Expand Down
43 changes: 22 additions & 21 deletions docs/modules/ROOT/pages/installation.adoc
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
= Installation

== From source (DUB)
== As a DUB dependency (preferred)

[source,json]
----
"dependencies": {
"ver": "~>0.2.4"
}
----

That pulls the **library** configuration from https://code.dlang.org/packages/ver[code.dlang.org].

== From source

[source,bash]
----
git clone https://github.com/dev-centr/ver.git
cd ver
dub build --config=cli --build=release
dub build --config=library --build=release
# Optional Qt GUI (needs Qt 6 + dqt):
# Optional Qt GUI (needs Qt 6 + dqt git binding):
dub build --config=gui --build=release
----

== As a DUB dependency
== Dependencies: Dub vs git vs binaries

[source,json]
----
"dependencies": {
"ver": "~>0.2.0"
}
----
| What | How to consume |
| ---- | -------------- |
| `ver` library/CLI recipe | DUB registry (`"ver": "~>0.2.4"`) |
| `dqt` (D bindings) | Git dependency on a commit/branch (temporary fork until upstream merges `QSystemTrayIcon`) |
| Qt 6 itself | System package / aqtinstall / official installer — **not** a DUB package |
| Prebuilt `ver` / `ver-gui` apps | GitHub Releases (one asset per OS/arch). Use for end users; D projects should depend on the library via DUB, not link those release binaries |

Until the package is on https://code.dlang.org[code.dlang.org], depend on git:

[source,json]
----
"dependencies": {
"ver": {
"repository": "git+https://github.com/dev-centr/ver.git",
"version": "~main"
}
}
----
There is no “Linux GUI job ships `.o` files to Windows for linking.” Each CI job installs Qt on that runner and builds natively.

== Releases

GitHub Releases attach CLI binaries and static libraries for Linux/Windows/macOS (x86_64 and arm64 where runners exist), plus a Linux `ver-gui` build.
GitHub Releases attach CLI + static library + GUI binaries for Linux/Windows/macOS (x86_64 and arm64 where runners exist).
2 changes: 1 addition & 1 deletion dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"dqt:widgets": {
"repository": "git+https://github.com/dlang-supplemental/dqt.git",
"version": "~master"
"version": "297b81b2cb7e0e40dc0c7192252c4f150f735865"
}
}
}
Expand Down
Loading