Skip to content

Commit

Permalink
Circleci project setup (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
Makopo authored Feb 22, 2023
1 parent bd19564 commit 0d1359f
Show file tree
Hide file tree
Showing 11 changed files with 349 additions and 146 deletions.
252 changes: 252 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
version: 2.1

orbs:
win: circleci/[email protected]

jobs:
build-osx:
macos:
xcode: 14.0.0
environment:
BUILD_VERSION_NUMBER: ${CIRCLE_TAG}
DEBUG: ""
steps:
- checkout
- run:
name: "make"
command: |
export PATH="/usr/local/opt/bison/bin:$PATH"
make
file -L lslint
- run:
name: "move"
command: |
mkdir -p binary/osx/
cp lslint binary/osx/
- persist_to_workspace:
root: binary
paths:
- osx/lslint
build-linux64:
docker:
- image: cimg/base:stable
resource_class: small
environment:
BUILD_VERSION_NUMBER: ${CIRCLE_TAG}
DEBUG: ""
steps:
- checkout
- run:
name: "install flex and bison"
command: |
sudo apt-get update
sudo apt-get install flex bison
- run:
name: "make"
command: |
make
file -L lslint
- run:
name: "move"
command: |
mkdir -p binary/linux64/
cp lslint binary/linux64/
cp kwdb_version.txt binary
- persist_to_workspace:
root: binary
paths:
- linux64/lslint
- kwdb_version.txt
build-linux32:
docker:
- image: cimg/base:stable
resource_class: small
environment:
BUILD_VERSION_NUMBER: ${CIRCLE_TAG}
BUILD_ADDITIONAL_ARG: "-m32"
DEBUG: ""
steps:
- checkout
- run:
name: "install flex and bison and i386 related modules"
command: |
sudo apt-get update
sudo apt-get install flex bison gcc-multilib g++-multilib
- run:
name: "make"
command: |
make
file -L lslint
- run:
name: "move"
command: |
mkdir -p binary/linux32/
cp lslint binary/linux32/
- persist_to_workspace:
root: binary
paths:
- linux32/lslint
build-windows64:
executor:
name: win/default
steps:
- checkout
- run:
name: place-flex_bison
command: |
curl.exe -L -O https://github.com/lexxmark/winflexbison/releases/download/v2.5.25/win_flex_bison-2.5.25.zip
mkdir C:\win_flex_bison
tar -xf win_flex_bison-2.5.25.zip -C C:\win_flex_bison
- run:
name: compile
command: |
$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
$instanceId = & $vswhere -property instanceId -format value
$installationPath = & $vswhere -property installationPath -format value
Import-Module (Join-Path $installationPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell $instanceId -SkipAutomaticLocation -Arch amd64
$Env:BUILD_VERSION_NUMBER="$Env:CIRCLE_TAG"
$Env:BUILD_DATE="$(Get-Date -Format "yyyy-MM-dd")"
$Env:Path+=";C:\win_flex_bison"
nmake /F NMakefile
dumpbin /headers lslint.exe
- run:
name: move
command: |
mkdir binary\win64
cp lslint.exe binary\win64
- persist_to_workspace:
root: binary
paths:
- win64/lslint.exe
build-windows32:
executor:
name: win/default
steps:
- checkout
- run:
name: place-flex_bison
command: |
curl.exe -L -O https://github.com/lexxmark/winflexbison/releases/download/v2.5.25/win_flex_bison-2.5.25.zip
mkdir C:\win_flex_bison
tar -xf win_flex_bison-2.5.25.zip -C C:\win_flex_bison
- run:
name: compile
command: |
$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
$instanceId = & $vswhere -property instanceId -format value
$installationPath = & $vswhere -property installationPath -format value
Import-Module (Join-Path $installationPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell $instanceId -SkipAutomaticLocation -Arch x86
$Env:BUILD_VERSION_NUMBER="$Env:CIRCLE_TAG"
$Env:BUILD_DATE="$(Get-Date -Format "yyyy-MM-dd")"
$Env:Path+=";C:\win_flex_bison"
nmake /F NMakefile
dumpbin /headers lslint.exe
- run:
name: zip
command: |
mkdir binary\win32
cp lslint.exe binary\win32
- persist_to_workspace:
root: binary
paths:
- win32/lslint.exe
release:
docker:
- image: cimg/go:1.20
resource_class: small
steps:
- attach_workspace:
at: ./artifacts
- store_artifacts:
path: ./artifacts
- run:
name: zip
command: |
mkdir zips
pushd artifacts/win32/; zip ../../zips/lslint_${CIRCLE_TAG}_win32.zip lslint.exe; popd
pushd artifacts/win64/; zip ../../zips/lslint_${CIRCLE_TAG}_win64.zip lslint.exe; popd
pushd artifacts/linux32/; zip ../../zips/lslint_${CIRCLE_TAG}_linux32.zip lslint; popd
pushd artifacts/linux64/; zip ../../zips/lslint_${CIRCLE_TAG}_linux64.zip lslint; popd
pushd artifacts/osx/; zip ../../zips/lslint_${CIRCLE_TAG}_osx.zip lslint; popd
- run:
name: "Publish Release on GitHub"
command: |
RELEASE_BODY="$(tail -n +2 artifacts/kwdb_version.txt)"
go install github.com/tcnksm/ghr@latest
ghr -t "${GITHUB_TOKEN}" -u "${CIRCLE_PROJECT_USERNAME}" -r "${CIRCLE_PROJECT_REPONAME}" -c "${CIRCLE_SHA1}" -b "${RELEASE_BODY}" -delete "${CIRCLE_TAG}" zips/
check-builtins:
docker:
- image: cimg/python:3.11
resource_class: small
steps:
- checkout
- add_ssh_keys:
fingerprints:
- "4f:89:75:4a:ac:38:d6:86:6a:99:d3:77:5a:cf:dd:32"
- run:
name: fetch_and_compare
command: |
curl -O https://raw.githubusercontent.com/Sei-Lisa/kwdb/master/outputs/builtins.txt
hasdiff=$(git status --porcelain builtins.txt)
if [ -n "${hasdiff}" ] ; then
make builtins_txt.cc
curl https://raw.githubusercontent.com/Sei-Lisa/kwdb/master/lsl2dfg/LSL2dfg.py -o /tmp/LSL2dfg.py
curl https://raw.githubusercontent.com/Sei-Lisa/kwdb/master/database/kwdb.xml -o /tmp/kwdb.xml
python /tmp/LSL2dfg.py --version --grid=sl,os --database=/tmp/kwdb.xml > kwdb_version.txt
git config user.name "Makopoppo(via CircleCI)"
git config user.email "[email protected]"
git add builtins.txt builtins_txt.cc kwdb_version.txt
git commit -m "update builtins_txt [ci skip]"
git push --set-upstream origin ${CIRCLE_BRANCH}
fi
parameters:
run-schedule:
type: boolean
default: false

workflows:
release-all:
when:
not: << pipeline.parameters.run-schedule >>
jobs:
- build-linux64:
filters:
tags:
only: /.*/
- build-linux32:
filters:
tags:
only: /.*/
- build-windows64:
filters:
tags:
only: /.*/
- build-windows32:
filters:
tags:
only: /.*/
- build-osx:
filters:
tags:
only: /.*/
- release:
filters:
tags:
only:
- /.*/
branches:
ignore: /.*/
requires:
- build-linux32
- build-linux64
- build-windows64
- build-windows32
- build-osx
check-builtins:
when: << pipeline.parameters.run-schedule >>
jobs:
- check-builtins

22 changes: 0 additions & 22 deletions .github/workflows/pull_builtins_txt.yml

This file was deleted.

63 changes: 32 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
# Compiler output files #
#########################
*.o
*.obj
*.output
lslint
*.log
*db
*.tlog
*.lastbuildstate
*.ilk
lex.yy.c
lslmini.tab.*
*.pdb
.vs\*
build_dir\
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
*.suo
/binary
# Editor backups #
##################
*~
/.vs
# Compiler output files #
#########################
*.o
*.obj
*.output
lslint
lslint.exe
*.log
*db
*.tlog
*.lastbuildstate
*.ilk
lex.yy.c
lslmini.tab.*
*.pdb
.vs\*
build_dir\
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
*.suo
/binary
# Editor backups #
##################
*~
/.vs
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions NMakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_NUMBER = v1.2.7
BUILD_DATE = %DATE:~-10,4%-%DATE:~-5,2%-%DATE:~-2,2%
VERSION_NUMBER = $(BUILD_VERSION_NUMBER)
BUILD_DATE = $(BUILD_DATE)

#
# 1. Download "Win flex-bison" and unpack it
Expand All @@ -9,7 +9,7 @@ BUILD_DATE = %DATE:~-10,4%-%DATE:~-5,2%-%DATE:~-2,2%
# You need the windows 7.0 SDK or later.
# For Windows XP compatible binaries, the windows 7.0 or 7.1 SDK is required.
#
# 3. Add 1. unpacked directory to PATH.
# 3. Add 1. unpacked directory to PATH. VERSION_NUMBER and BUILD_DATE are also required.
#
# 4. Run "nmake /F NMakefile" to build or "nmake /F NMakefile debug=1" to build debuggable binary.
#
Expand Down
Loading

0 comments on commit 0d1359f

Please sign in to comment.