Skip to content

Improve QB64-PE extraction process by relocating setup scripts to the… #5

Improve QB64-PE extraction process by relocating setup scripts to the…

Improve QB64-PE extraction process by relocating setup scripts to the… #5

Workflow file for this run

name: Build and Test
on:
push:
branches: [main, master]
paths-ignore:
- "**.md"
- "screenshots/**"
pull_request:
branches: [main, master]
jobs:
build-test:
name: Build & Test (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux-x64
os: ubuntu-latest
asset_pattern: "qb64pe_lnx-*.tar.gz"
bin_name: Brainfuck64
- name: Windows-x64
os: windows-latest
asset_pattern: "qb64pe_win-x64-*.7z"
bin_name: Brainfuck64.exe
- name: Windows-x86
os: windows-latest
asset_pattern: "qb64pe_win-x86-*.7z"
bin_name: Brainfuck64.exe
- name: Windows-arm64
os: windows-11-arm
asset_pattern: "qb64pe_win-arm64-*.7z"
bin_name: Brainfuck64.exe
- name: macOS-x64
os: macos-latest
asset_pattern: "qb64pe_osx-*.tar.gz"
bin_name: Brainfuck64
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev libx11-dev libxext-dev
- name: Download QB64-PE
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download -R QB64-Phoenix-Edition/QB64pe -p "${{ matrix.asset_pattern }}" --dir qb64_dl
- name: Extract & Setup QB64-PE (Unix)
if: runner.os != 'Windows'
run: |
mkdir qb64pe
tar -xzf qb64_dl/*.tar.gz -C qb64pe
# Find the setup script and move everything from its directory to qb64pe root
SETUP_PATH=$(find qb64pe -name "setup_lnx.sh" -o -name "setup_osx.command" | head -n 1)
if [ -z "$SETUP_PATH" ]; then
echo "Error: Setup script not found in tarball."
ls -R qb64pe
exit 1
fi
SETUP_DIR=$(dirname "$SETUP_PATH")
if [ "$SETUP_DIR" != "qb64pe" ]; then
mv "$SETUP_DIR"/* qb64pe/
fi
cd qb64pe
if [[ "${{ runner.os }}" == "Linux" ]]; then
chmod +x setup_lnx.sh
./setup_lnx.sh
else
chmod +x setup_osx.command
./setup_osx.command
fi
- name: Extract QB64-PE (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
7z x qb64_dl/*.7z -oqb64pe
$subFolder = Get-ChildItem -Path qb64pe -Directory | Select-Object -First 1
if ($subFolder) {
Move-Item -Path "$($subFolder.FullName)\*" -Destination qb64pe\
}
- name: Build and Test
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
export QB64PE_PATH=$(pwd -W)/qb64pe
mingw32-make test
else
export QB64PE_PATH=$(pwd)/qb64pe
make test
fi
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-bin
path: ${{ matrix.bin_name }}
if-no-files-found: error