Skip to content

Commit

Permalink
just use ubuntu-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgriffin committed Nov 9, 2024
1 parent 51a1145 commit da168d3
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 86 deletions.
131 changes: 59 additions & 72 deletions .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,85 +8,72 @@ on:
branches:
- main


jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_HOST: tcp://localhost:2375
services:
docker:
image: docker:19.03.12-dind
options: --privileged
ports:
- 2375:2375

runs-on: ubuntu-latest # GitHub-hosted runner with Docker installed
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker environment
run: |
sudo service docker start
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Setup xvfb (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xinput0 \
libxcb-xfixes0 \
libxcb-shape0 \
libglib2.0-0 \
libgl1-mesa-dev \
'^libxcb.*-dev' \
libx11-xcb-dev \
libglu1-mesa-dev \
libxrender-dev \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libsecp256k1-0
- name: Setup xvfb (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xinput0 \
libxcb-xfixes0 \
libxcb-shape0 \
libglib2.0-0 \
libgl1-mesa-dev \
'^libxcb.*-dev' \
libx11-xcb-dev \
libglu1-mesa-dev \
libxrender-dev \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libsecp256k1-0
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run build script
run: poetry run python tools/build.py --targets appimage windows
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run build script
run: poetry run python tools/build.py --targets appimage windows


- name: Check for AppImage file
run: |
if [ -z "$(find dist -type f -name '*.AppImage')" ]; then
echo "AppImage file is missing"
exit 1
fi
- name: Check for AppImage file
run: |
if [ -z "$(find dist -type f -name '*.AppImage')" ]; then
echo "AppImage file is missing"
exit 1
fi
- name: Check for portable EXE file
run: |
if [ -z "$(find dist -type f -name '*portable.exe')" ]; then
echo "Portable EXE file is missing"
exit 1
fi
- name: Check for portable EXE file
run: |
if [ -z "$(find dist -type f -name '*portable.exe')" ]; then
echo "Portable EXE file is missing"
exit 1
fi
- name: Check for setup EXE file
run: |
if [ -z "$(find dist -type f -name '*setup.exe')" ]; then
echo "Setup EXE file is missing"
exit 1
fi
- name: Check for setup EXE file
run: |
if [ -z "$(find dist -type f -name '*setup.exe')" ]; then
echo "Setup EXE file is missing"
exit 1
fi
14 changes: 0 additions & 14 deletions tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,6 @@ def build_windows_exe_and_installer_docker(
build_commit=build_commit,
)

def set_docker_environment(self):
# Check if running in GitHub Actions
if 'GITHUB_ACTIONS' in os.environ:
# Set DOCKER_HOST only if running in GitHub Actions
os.environ['DOCKER_HOST'] = 'tcp://localhost:2375'
else:
# Optionally, handle local settings or leave as default for local Docker usage
if 'DOCKER_HOST' not in os.environ:
# Set to default Unix socket if not specified, or just omit this block to use system default
os.environ['DOCKER_HOST'] = 'unix:///var/run/docker.sock'


def build_in_docker(
self,
docker_image: str,
Expand All @@ -183,8 +171,6 @@ def build_in_docker(
BUILD_UID = PROJECT_ROOT.stat().st_uid
BUILD_CACHEDIR = path_build / ".cache"
original_dir = os.getcwd()

self.set_docker_environment()

# Initialize DOCKER_BUILD_FLAGS
DOCKER_BUILD_FLAGS = ""
Expand Down

0 comments on commit da168d3

Please sign in to comment.