Skip to content

Commit

Permalink
Update build infra to new versinos
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdaemon committed Jan 27, 2024
1 parent 8cda02d commit 7fa8e57
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@ on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-18.04
strategy:
matrix:
version:
- "3.16.1"
- "3.16.0"
os:
- "ubuntu-22.04"
- "ubuntu-20.04"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- run: sudo apt update -y -qq
Expand All @@ -22,12 +31,14 @@ jobs:
libpcre3-dev \
libwww-perl \
libgnutls28-dev
- run: bash install.sh
- run: tar cvzf inspircd.tar.gz run/
- run: bash install.sh ${{ matrix.version }}
- id: commit
uses: prompt/actions-commit-hash@v3
- run: tar cvzf inspircd.${{matrix.version}}-${{steps.commit.outputs.short}}.${{matrix.os}}.tar.gz run/
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: inspircd.tar.gz
files: inspircd*.tar.gz
24 changes: 6 additions & 18 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#!/bin/bash
set -e

# Set this to the version of InspIRCd to install
INSTALL_VERSION="3.8.1"

BASE_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
BUILD_PREFIX="${BASE_DIR}/run"
BASE_DIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")

vendor_extra() {
./configure --enable-extra "${1}"
Expand All @@ -22,10 +18,7 @@ apply_patch() {
}

apply_patches() {
# Fixes a bug in the SHA1 module which prevents us from having WebSocket listeners.
apply_patch "https://github.com/inspircd/inspircd/commit/612f4fbe0e98d4bfe5c5527ef2e8153a6600e090.patch"
# Fixes a security vulnerability in core_user
apply_patch "https://github.com/inspircd/inspircd/commit/6fbe4dd791e62005c5243762cf6bd01b48ed9d73.patch"
echo "Applying patches";
}

install_extras() {
Expand All @@ -46,29 +39,24 @@ install_extras() {
third_extra 'm_totp'
third_extra 'm_globalmessageflood'
third_extra 'm_slowmode'
third_extra 'm_telegraf'
}

install() {
version="${1}"
version_name="inspircd-${version}"
url="https://codeload.github.com/inspircd/inspircd/tar.gz/v${version}"
[ -d "${BASE_DIR}/${version_name}" ] && rm -r "${BASE_DIR:?}/${version_name}"
[ -d "${BASE_DIR:?}/${version_name}" ] && rm -r "${BASE_DIR:?}/${version_name}"
wget -O - "${url}" | tar zx
cd "${BASE_DIR}/${version_name}"
cd "${BASE_DIR:?}/${version_name}"
install_extras
apply_patches

export CXXFLAGS="-std=c++11"
./configure --disable-auto-extras --prefix "${BUILD_PREFIX}"
./configure --disable-auto-extras --prefix "${BASE_DIR:?}/run"
make clean && make --jobs "$(nproc)" && make install
}

if [ $# -ne 0 ]; then
VERSION="${1}"
else
VERSION="${INSTALL_VERSION}"
fi
VERSION="${1}"

if [ "${VERSION}""x" = "x" ]; then
echo "No install version specified, exiting..."
Expand Down

0 comments on commit 7fa8e57

Please sign in to comment.