-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from theavege/add/github-ci
Add/GitHub ci
- Loading branch information
Showing
5 changed files
with
156 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "${@}" |