diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..23c4cb3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..672235a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +--- +name: Build + +on: + push: + branches: + - "**" + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + strategy: + matrix: + os: + - ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Build on Linux + if: runner.os == 'Linux' + shell: bash + run: bash -x make.sh all diff --git a/build.sh b/build.sh deleted file mode 100644 index e9701b0..0000000 --- a/build.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/sh - -set -e - -# if you compile first time you must change variable "lazpath" and "lcl" -# after it execute this script with parameter "all" at awgg dir -# "./build.sh all" it build awgg -# by Segator - - -# You can execute this script with different parameters: -# default - compiling AWGG only (using by default) - -# path to lazbuild -export lazbuild=$(which lazbuild) - -# Set up widgetset: gtk or gtk2 or qt -# Set up processor architecture: i386 or x86_64 -if [ $2 ] - then export lcl=$2 -fi -if [ $lcl ] && [ $CPU_TARGET ] - then export AWGG_ARCH=$(echo "--widgetset=$lcl")" "$(echo "--cpu=$CPU_TARGET") -elif [ $lcl ] - then export AWGG_ARCH=$(echo "--widgetset=$lcl") -elif [ $CPU_TARGET ] - then export AWGG_ARCH=$(echo "--cpu=$CPU_TARGET") -fi - -build_default() -{ - $lazbuild src/awgg.lpi $AWGG_ARCH - - strip awgg -} - -build_beta() -{ - - # Build versionitis - $lazbuild src/versionitis.lpi - - # Update version - src/versionitis -verbose - - # Build AWGG - $lazbuild src/awgg.lpi --bm=beta $AWGG_ARCH - - # Build Dwarf LineInfo Extractor - $lazbuild tools/extractdwrflnfo.lpi - - # Extract debug line info - chmod a+x tools/extractdwrflnfo - if [ -f awgg.dSYM/Contents/Resources/DWARF/awgg ]; then - mv -f awgg.dSYM/Contents/Resources/DWARF/awgg $(pwd)/awgg.dbg - fi - tools/extractdwrflnfo awgg.dbg - - # Strip debug info - strip awgg -} -build_release() -{ - - # Build versionitis - $lazbuild src/versionitis.lpi - - # Update version - src/versionitis -verbose - - # Build AWGG - $lazbuild src/awgg.lpi --bm=release $AWGG_ARCH - - # Build Dwarf LineInfo Extractor - $lazbuild tools/extractdwrflnfo.lpi - - # Extract debug line info - chmod a+x tools/extractdwrflnfo - if [ -f awgg.dSYM/Contents/Resources/DWARF/awgg ]; then - mv -f awgg.dSYM/Contents/Resources/DWARF/awgg $(pwd)/awgg.dbg - fi - tools/extractdwrflnfo awgg.dbg - - # Strip debug info - strip awgg -} - -build_all() -{ - build_default -} - - -case $1 in - beta) build_beta;; - release) build_release;; - all) build_all;; - *) build_default;; -esac diff --git a/clean.sh b/clean.sh deleted file mode 100644 index 3b0a9ce..0000000 --- a/clean.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Clean up all temporary files -find . -iname '*.compiled' -delete -find . -iname '*.ppu' -delete -find . -iname '*.o' -delete -find src/ -iname '*.bak' -delete -find src/ -iname '*.or' -delete - -rm -f src/awgg.res doublecmd -rm -f tools/extractdwrflnfo -rm -rf src/lib -rm -rf src/backup -rm -r units/* -rm -f src/versionitis - -# Remove debug files -rm -f awgg.zdli awgg.dbg -rm -rf awgg.dSYM -rm -f awgg diff --git a/make.sh b/make.sh new file mode 100644 index 0000000..220f56f --- /dev/null +++ b/make.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash +# if you compile first time you must change variable "lazpath" and "lcl" +# after it execute this script with parameter "all" at awgg dir +# "./build.sh all" it build awgg +# by Segator +# You can execute this script with different parameters: +# default - compiling AWGG only (using by default) + +function log +{ + declare -rAi TAG=( + [error]=31 + [info]=32 + [audit]=33 + ) + printf '%(%y-%m-%d_%T)T\x1b[%dm\t%s:\t%b\x1b[0m\n' -1 "${TAG[${1,,:?}]}" "${1^^}" "${2:?}" 1>&2 + if [[ ${1} == 'error' ]]; then + return 1 + fi +} + +function clean # Clean up all temporary files +{ + find . -iname '*.compiled' -delete + find . -iname '*.ppu' -delete + find . -iname '*.o' -delete + find src/ -iname '*.bak' -delete + find src/ -iname '*.or' -delete + + rm -f src/awgg.res doublecmd + rm -f tools/extractdwrflnfo + rm -rf src/lib + rm -rf src/backup + rm -r units/* + rm -f src/versionitis + + # Remove debug files + rm -f awgg.zdli awgg.dbg + rm -rf awgg.dSYM + rm -f awgg +} + +function version_itis +{ + "${lazbuild}" src/versionitis.lpi # Build versionitis + src/versionitis -verbose # Update version +} + +function extract_dwrflnfo +{ + "${lazbuild}" tools/extractdwrflnfo.lpi # Build Dwarf LineInfo Extractor + chmod a+x 'tools/extractdwrflnfo' + declare -r DWARF='awgg.dSYM/Contents/Resources/DWARF/awgg' + if [[ -f "${DWARF}" ]]; then + mv -vf "${DWARF}" "${PWD}/awgg.dbg" + fi + tools/extractdwrflnfo awgg.dbg +} + +function build_default +{ + "${lazbuild}" src/awgg.lpi "${AWGG_ARCH[@]}" # Build AWGG + strip awgg # Strip debug info +} + +function build_beta +{ + version_itis + "${lazbuild}" src/awgg.lpi --bm=beta "${AWGG_ARCH[@]}" # Build AWGG + extract_dwrflnfo # Extract debug line info + strip awgg # Strip debug info +} + +function build_release +{ + version_itis + "${lazbuild}" src/awgg.lpi --bm=release "${AWGG_ARCH[@]}" # Build AWGG + extract_dwrflnfo # Extract debug line info + strip awgg # Strip debug info +} + +function main +{ + set -eo pipefail + if !(which lazbuild); then + source '/etc/os-release' + case ${ID:?} in + debian | ubuntu) + sudo apt-get update + sudo apt-get install -y lazarus + ;; + esac + fi + lazbuild=$(which lazbuild) # path to lazbuild + export lazbuild + + # Set up widgetset: gtk or gtk2 or qt + # Set up processor architecture: i386 or x86_64 + if [[ ${2} ]]; then + export lcl=${2} + fi + if [[ ${lcl} ]] && [[ ${CPU_TARGET} ]]; then + export -a AWGG_ARCH=("--widgetset=${lcl}" "--cpu=${CPU_TARGET}") + elif [[ ${lcl} ]]; then + export -a AWGG_ARCH=("--widgetset=${lcl}") + elif [[ ${CPU_TARGET} ]]; then + export -a AWGG_ARCH=("--cpu=${CPU_TARGET}") + fi + case ${1} in + clean) clean;; + beta) build_beta;; + release) build_release;; + all) build_default;; + esac +} + +main "${@}"