Skip to content

Commit

Permalink
CI improvements (#143)
Browse files Browse the repository at this point in the history
Various CI improvements:
* The macOS and Linux build scripts now create Python virtual environments.
* Fixed extra 'F' at the beginning of the Linux script.
* Updated the build documentation.
* Ensure libssl-dev is installed on Linux.
  • Loading branch information
braillescreen authored Dec 2, 2024
1 parent 36fc8b5 commit cf679ce
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v4
- name: build
run: |
brew install scons
pip3 install scons
cp build/build_macos.sh .
sudo chmod +x build_macos.sh
./build_macos.sh ci
Expand All @@ -24,6 +24,7 @@ jobs:
- uses: actions/checkout@v4
- name: build
run: |
pip3 install scons
sudo chmod +x build/build_linux.sh
./build/build_linux.sh ci
cd release
Expand Down Expand Up @@ -158,8 +159,11 @@ jobs:
mkdir windows_release
tar -xzf windows_release.tar.gz -C windows_release
tar -xzf linux_release.tar.gz -C release
python3 -m venv venv --upgrade-deps
chmod +x venv/bin/activate
source ./venv/bin/activate
cd doc
pip3 install --user -r requirements.txt
pip3 install -r requirements.txt
cd OSL
python3 make_osl_document.py
cd ..
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ lindev
macosdev
windev
deps
venv

# website builds
web/public_html
Expand Down
11 changes: 7 additions & 4 deletions build/build_linux.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
F#!/bin/bash
#!/bin/bash

function setup_angelscript {
echo Installing Angelscript...
Expand Down Expand Up @@ -108,8 +108,7 @@ function setup_nvgt {
cd ..
rm lindev.tar.gz
if ! which scons &> /dev/null; then
export PIP_BREAK_SYSTEM_PACKAGES=1
pip3 install --user scons
pip3 install scons
fi
scons -s no_upx=0
echo NVGT built.
Expand All @@ -118,11 +117,14 @@ function setup_nvgt {
function main {
sudo apt update -y
set -e
python3 -m venv venv --upgrade-deps
chmod +x venv/bin/activate
source ./venv/bin/activate
mkdir -p deps
cd deps

# Insure required packages are installed for building.
sudo apt install build-essential gcc g++ make cmake autoconf libtool python3 python3-pip libsystemd-dev libspeechd-dev -y
sudo apt install build-essential gcc g++ make cmake autoconf libtool python3 python3-pip libssl-dev libsystemd-dev libspeechd-dev -y

setup_angelscript
setup_reactphysics
Expand All @@ -132,6 +134,7 @@ function main {
setup_sdl
setup_nvgt
echo Success!
deactivate
exit 0
}

Expand Down
3 changes: 3 additions & 0 deletions build/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ function setup_nvgt {

function main {
set -e
python3 -m venv venv --upgrade-deps
chmod +x venv/bin/activate
source ./venv/bin/activate
mkdir -p deps
cd deps
setup_homebrew
Expand Down
10 changes: 6 additions & 4 deletions doc/src/advanced/Building NVGT For Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ There is a [script to build NVGT on Linux](https://raw.githubusercontent.com/sam

Internally, this script is used within our GitHub Actions to make builds of NVGT. It is also used within our local testing environments.

Note that this script will currently only run on systems where apt is installed, and does not support any other package managers.
### Notes
* This script will currently only run on systems where `apt` and `pip` are installed, and does not support any other package managers.
* This script will create and activate a [virtual environment](https://docs.python.org/3/library/venv.html).

This script can be ran in two modes:
* Adding `ci` as an argument causes the dependencies to be downloaded in the current working directory inside a `deps` folder (useful if you already are working from within NVGT).
* If `ci` is not present, the script will assume NVGT is not downloaded and will clone NVGT before attempting to build it.
* Adding `ci` as an argument causes the dependencies to be downloaded in the current working directory inside a `deps` folder (useful if you already are working from within NVGT's source directory).
* If `ci` is not present, the script will assume NVGT is not downloaded and will clone NVGT into the current directory before attempting to build it.

### Example of Running the script with the `ci` argument
It is assumed you are in a freshly-cloned NVGT, so that your working directory ends with `nvgt`.
Expand All @@ -28,7 +30,7 @@ chmod +x build_linux.sh
```

## Building NVGT manually
If you wish to build manually, some slightly older instructions are below.
If you wish to build manually, some rather old instructions are below. At this time, it would probably be much more beneficial to read the `build_linux.sh` script or [readme.md](https://github.com/samtupy/nvgt) for much more updated commands; the below commands are here for reference and aren't updated often.

Please keep in mind that this is a very very rough draft, I've only done this once before when I built nvgt's server components for stw. This will attempt to describe, even for a user who doesn't use linux much, how to build nvgt at least on Ubuntu 22.04 LTS.

Expand Down
9 changes: 6 additions & 3 deletions doc/src/advanced/Building NVGT for MacOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ There is a [script to build NVGT on macOS](https://raw.githubusercontent.com/sam

Internally, this script is used within our GitHub Actions to make builds of NVGT. It is also used within our local testing environments.

### Notes
* This script will create and activate a [virtual environment](https://docs.python.org/3/library/venv.html).

This script can be ran in two modes:
* Adding `ci` as an argument causes the dependencies to be downloaded in the current working directory inside a `deps` folder (useful if you already are working from within NVGT).
* If `ci` is not present, the script will assume NVGT is not downloaded and will clone NVGT before attempting to build it.
* Adding `ci` as an argument causes the dependencies to be downloaded in the current working directory inside a `deps` folder (useful if you already are working from within NVGT's source directory).
* If `ci` is not present, the script will assume NVGT is not downloaded and will clone NVGT into the current directory before attempting to build it.

### Example of Running the script with the `ci` argument
It is assumed you are in a freshly-cloned NVGT, so that your working directory ends with `nvgt`.
Expand All @@ -28,7 +31,7 @@ chmod +x build_macos.sh


## Building NVGT manually
Below are some older notes for building NVGT for macOS.
If you wish to build manually, some rather old instructions are below. At this time, it would probably be much more beneficial to read the `build_macos.sh` script or [readme.md](https://github.com/samtupy/nvgt) for much more updated commands; the below commands are here for reference and aren't updated often.

Assuming xcode and homebrew are installed:

Expand Down

0 comments on commit cf679ce

Please sign in to comment.