Skip to content

docs: specifies the offline new workaround #424

docs: specifies the offline new workaround

docs: specifies the offline new workaround #424

Workflow file for this run

name: Build
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x64
- os: windows-latest
arch: x64
- os: macos-15
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Setup (Linux)
if: ${{ runner.os == 'Linux' }}
id: setup-linux
run: |
sudo apt-get install tree rpm
mkdir -p ./release
NAME="$(uv run python -c 'from src.utils.constants import get_name; print(get_name())')"
VERSION="$(uv run python -c 'from src.utils.constants import get_version; print(get_version())')"
DESCRIPTION="$(uv run python -c 'from src.utils.constants import get_description; print(get_description())')"
echo "name=${NAME}" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "description=${DESCRIPTION}" >> $GITHUB_OUTPUT
- name: Setup (MacOS)
if: ${{ runner.os == 'macOS' }}
id: setup-macos
run: |
brew install create-dmg
brew reinstall openssl@3
brew unlink openssl@3 && brew link --force --overwrite openssl@3
OPENSSL_FULL_VERSION=$(openssl version | awk '{ print $2}')
OPENSSL_PATH="/opt/homebrew/Cellar/openssl@3/${OPENSSL_FULL_VERSION}"
echo "dyld-path=${OPENSSL_PATH}/lib" >> $GITHUB_OUTPUT
- name: Install project and its dependencies
run: uv sync
- name: Build dist (Linux)
if: ${{ runner.os == 'Linux' }}
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
with:
run: |
uv add pytest-xvfb
uv run poe build-linux
- name: Build dist (MacOS)
if: ${{ runner.os == 'macOS' }}
env:
DYLD_LIBRARY_PATH: ${{ steps.setup-macos.outputs.dyld-path }}
run: uv run poe build-macos
- name: Build dist (Windows)
if: ${{ runner.os == 'Windows' }}
env:
KIVY_GL_BACKEND: "angle_sdl2"
run: uv run poe build-win
- name: Build release deb (Linux)
if: ${{ runner.os == 'Linux' }}
id: release-deb
env:
NAME: ${{ steps.setup-linux.outputs.name }}
VERSION: ${{ steps.setup-linux.outputs.version }}
DESCRIPTION: ${{ steps.setup-linux.outputs.description }}
run: |
BINARY_PATH="./dist/krux-installer"
sh .ci/create-deb.sh \
-a "${NAME}" \
-o ./release \
-v $VERSION \
-A amd64 \
-m qlrd \
-e qlrddev@gmail.com \
-d "${DESCRIPTION}" \
-b "${BINARY_PATH}" \
-i ./assets/icon.png
tree ./release
echo "build-path=$(pwd)/release" >> $GITHUB_OUTPUT
echo "pkg=${NAME}_${VERSION}_amd64.deb" >> $GITHUB_OUTPUT
- name: Build release rpm (Linux)
if: ${{ runner.os == 'Linux' }}
id: release-rpm
env:
NAME: ${{ steps.setup-linux.outputs.name }}
VERSION: ${{ steps.setup-linux.outputs.version }}
DESCRIPTION: ${{ steps.setup-linux.outputs.description }}
run: |
RPM_VERSION=$(sed -e 's/-/_/g' <<< $VERSION)
BINARY_PATH="./dist/krux-installer"
sh .ci/create-rpm.sh \
-a "${NAME}" \
-v $RPM_VERSION \
-m qlrd \
-e qlrddev@gmail.com \
-d "${DESCRIPTION}" \
-c ./CHANGELOG.md \
-r ./README.md \
-b "${BINARY_PATH}" \
-i ./assets/icon.png
tree ./release
rpmbuild -vv -bb --define "_bindir /usr/local/bin" $HOME/rpmbuild/SPECS/$NAME.spec
cp $HOME/rpmbuild/RPMS/x86_64/${NAME}-${RPM_VERSION}-1.x86_64.rpm ./release/${NAME}-${RPM_VERSION}-1.x86_64.rpm4
echo "build-path=${HOME}/rpmbuild/RPMS/x86_64" >> $GITHUB_OUTPUT
echo "pkg=${NAME}-${RPM_VERSION}-1.x86_64.rpm" >> $GITHUB_OUTPUT
- name: Build release dmg (MacOS)
if: ${{ runner.os == 'macOS' }}
id: release-macos
run: |
NAME="$(uv run python -c 'from src.utils.constants import get_name; print(get_name())')"
VER="$(uv run python -c 'from src.utils.constants import get_version; print(get_version())')"
ARCH="$(uname -m)"
APP_NAME="krux-installer"
mkdir -p ./release
create-dmg --volname "${NAME}" --volicon ./assets/icon.icns --window-pos 200 120 --window-size 800 400 --icon-size 100 --icon "${APP_NAME}.app" 200 190 --app-drop-link 600 185 "./release/${NAME}_${VER}_${ARCH}.dmg" "./dist/${APP_NAME}.app"
echo "build-path=$(pwd)/release" >> $GITHUB_OUTPUT
echo "pkg=${NAME}_${VER}_${ARCH}.dmg" >> $GITHUB_OUTPUT
- name: Build release NSIS (Windows)
if: ${{ runner.os == 'Windows' }}
id: release-windows
shell: pwsh
run: |
choco install nsis -y
$nsisPath = "C:\Program Files (x86)\NSIS\makensis.exe"
if (-not (Test-Path $nsisPath)) {
throw "NSIS not found at expected location: $nsisPath"
}
Write-Host "Found NSIS at: $nsisPath"
New-Item ".\release" -Type Directory -ErrorAction SilentlyContinue
$name = uv run python -c 'from src.utils.constants import get_name; print(get_name())'
$version = uv run python -c 'from src.utils.constants import get_version; print(get_version())'
$description = uv run python -c 'from src.utils.constants import get_description; print(get_description())'
uv run python .ci/create-nsis.py -a $name -b .\dist\krux-installer.exe -o selfcustody -V $version -d "$description" -l .\LICENSE -i .\assets\icon.ico -O .
& $nsisPath ".\${name}.nsi"
$setupFile = ".\${name} Setup.exe"
Write-Host "Looking for setup file: $setupFile"
if (-not (Test-Path $setupFile)) {
Get-ChildItem -Path "." -Filter "*Setup.exe" | ForEach-Object { Write-Host "Found: $($_.Name)" }
throw "Setup file not found at: $setupFile"
}
Move-Item -Path $setupFile -Destination ".\release\${name}_v${version}_Setup.exe"
echo "build-path=$pwd\release" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "pkg=${name}_v${version}_Setup.exe" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Hash (Linux deb)
if: ${{ runner.os == 'Linux' }}
uses: qlrd/sha256sum-action@v3
id: hash-deb
with:
working-directory: ${{ steps.release-deb.outputs.build-path }}
file: ${{ steps.release-deb.outputs.pkg }}
ext: "sha256.txt"
- name: Hash (Linux rpm)
if: ${{ runner.os == 'Linux' }}
uses: qlrd/sha256sum-action@v3
id: hash-rpm
with:
working-directory: ${{ steps.release-rpm.outputs.build-path }}
file: ${{ steps.release-rpm.outputs.pkg }}
ext: "sha256.txt"
- name: Hash (MacOS)
if: ${{ runner.os == 'macOS' }}
uses: qlrd/sha256sum-action@v3
id: hash-macos
with:
working-directory: ${{ steps.release-macos.outputs.build-path }}
file: ${{ steps.release-macos.outputs.pkg }}
ext: "sha256.txt"
- name: Hash (Windows)
if: ${{ runner.os == 'Windows' }}
uses: qlrd/sha256sum-action@v3
id: hash-win
with:
working-directory: ${{ steps.release-windows.outputs.build-path }}
file: ${{ steps.release-windows.outputs.pkg }}
ext: "sha256.txt"
- name: Upload artifact deb (Linux)
if: ${{ runner.os == 'Linux' }}
uses: actions/upload-artifact@v7
with:
name: ${{ steps.release-deb.outputs.pkg }}
path: |
${{ steps.release-deb.outputs.build-path}}/${{ steps.release-deb.outputs.pkg }}
${{ steps.release-deb.outputs.build-path}}/${{ steps.release-deb.outputs.pkg }}.sha256.txt
- name: Upload artifact rpm (Linux)
if: ${{ runner.os == 'Linux' }}
uses: actions/upload-artifact@v7
with:
name: ${{ steps.release-rpm.outputs.pkg }}
path: |
${{ steps.release-rpm.outputs.build-path}}/${{ steps.release-rpm.outputs.pkg }}
${{ steps.release-rpm.outputs.build-path}}/${{ steps.release-rpm.outputs.pkg }}.sha256.txt
- name: Upload artifacts (MacOS)
if: ${{ runner.os == 'macOS' }}
uses: actions/upload-artifact@v7
with:
name: ${{ steps.release-macos.outputs.pkg }}
path: |
${{ steps.release-macos.outputs.build-path}}/${{ steps.release-macos.outputs.pkg }}
${{ steps.release-macos.outputs.build-path}}/${{ steps.release-macos.outputs.pkg }}.sha256.txt
- name: Upload artifacts (Windows)
if: ${{ runner.os == 'Windows' }}
uses: actions/upload-artifact@v7
with:
name: ${{ steps.release-windows.outputs.pkg }}
path: |
${{ steps.release-windows.outputs.build-path}}/${{ steps.release-windows.outputs.pkg }}
${{ steps.release-windows.outputs.build-path}}/${{ steps.release-windows.outputs.pkg }}.sha256.txt