Skip to content

Commit

Permalink
Merge pull request #20 from theavege/add/github-ci
Browse files Browse the repository at this point in the history
Add/GitHub ci
  • Loading branch information
Nenirey authored Oct 24, 2024
2 parents 6daa550 + f68bca8 commit dde4d7d
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 118 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
99 changes: 0 additions & 99 deletions build.sh

This file was deleted.

19 changes: 0 additions & 19 deletions clean.sh

This file was deleted.

117 changes: 117 additions & 0 deletions make.sh
Original file line number Diff line number Diff line change
@@ -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 "${@}"

0 comments on commit dde4d7d

Please sign in to comment.