mirror of https://github.com/tstellar/bygfoot.git
Compare commits
5 Commits
2.3.3-alph
...
build-impr
Author | SHA1 | Date |
---|---|---|
|
ba8eefd386 | |
|
04daad024a | |
|
dd115a7e69 | |
|
bc4a6ded85 | |
|
e2aa29cf47 |
|
@ -9,72 +9,117 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BYGFOOT_VERSION: "2.3.3-unofficial-git-${{ github.sha }}"
|
UBUNTU_BUILD_DEPENDENCIES: libglib2.0-dev libgtk2.0-dev libpango1.0-dev libatk1.0-dev libfreetype6-dev ninja-build cmake libjson-c-dev unzip
|
||||||
|
LINUX_BUILD_DEPENDENCIES: libglib2.0-dev libgtk2.0-dev libpango1.0-dev libatk1.0-dev libfreetype6-dev ninja-build cmake
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
package-linux:
|
|
||||||
|
set-variables:
|
||||||
runs-on:
|
runs-on:
|
||||||
- ubuntu-16.04
|
- ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
is-tag: ${{ steps.vars.outputs.is-tag }}
|
||||||
|
bygfoot-version: ${{ steps.vars.outputs.bygfoot-version }}
|
||||||
|
steps:
|
||||||
|
- id: vars
|
||||||
|
run: |
|
||||||
|
if echo ${{ github.ref }} | grep '^refs/tags'; then
|
||||||
|
is_tag=1
|
||||||
|
bygfoot_version=`echo ${{ github.ref }} | cut -d / -f 3`
|
||||||
|
else
|
||||||
|
is_tag=0
|
||||||
|
bygfoot_version=${{ github.head_ref }}-${{ github.sha }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
tarname=bygfoot-$bygfoot_version-${{ matrix.name }}
|
||||||
|
echo "::set-output name=is-tag::$is_tag"
|
||||||
|
echo "::set-output name=bygfoot-version::$bygfoot_version"
|
||||||
|
|
||||||
|
package-linux:
|
||||||
|
needs:
|
||||||
|
- set-variables
|
||||||
|
runs-on:
|
||||||
|
- ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ${{ matrix.container-image }}
|
||||||
|
env:
|
||||||
|
BYGFOOT_VERSION: ${{ needs.set-variables.outputs.bygfoot-version }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
build-type:
|
|
||||||
- full
|
|
||||||
- minimal
|
|
||||||
include:
|
include:
|
||||||
- build-type: full
|
- name: ubuntu-16.04
|
||||||
extra-deps: libjson-c-dev
|
container-image: docker.io/ubuntu:16.04
|
||||||
build-suffix: ""
|
dependencies: "$UBUNTU_BUILD_DEPENDENCIES"
|
||||||
- build-type: minimal
|
test: true
|
||||||
extra-deps: ""
|
- name: ubuntu-18.04
|
||||||
build-suffix: -minimal
|
container-image: docker.io/ubuntu:18.04
|
||||||
|
dependencies: "$UBUNTU_BUILD_DEPENDENCIES"
|
||||||
|
test: true
|
||||||
|
- name: ubuntu-20.04
|
||||||
|
container-image: docker.io/ubuntu:20.04
|
||||||
|
dependencies: "$UBUNTU_BUILD_DEPENDENCIES"
|
||||||
|
test: true
|
||||||
|
- name: ubuntu-20.10
|
||||||
|
container-image: docker.io/ubuntu:20.10
|
||||||
|
dependencies: "$UBUNTU_BUILD_DEPENDENCIES"
|
||||||
|
test: true
|
||||||
|
- name: ubuntu-21.04
|
||||||
|
container-image: docker.io/ubuntu:21.04
|
||||||
|
dependencies: "$UBUNTU_BUILD_DEPENDENCIES"
|
||||||
|
test: true
|
||||||
|
- name: linux
|
||||||
|
container-image: docker.io/ubuntu:16.04
|
||||||
|
dependencies: "$LINUX_BUILD_DEPENDENCIES"
|
||||||
|
test: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt-get install libglib2.0-dev libgtk2.0-dev libpango1.0-dev libatk1.0-dev libfreetype6-dev ninja-build
|
env:
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
- name: Install extra dependencies
|
run: |
|
||||||
if: ${{ matrix.extra-deps != '' }}
|
apt-get update
|
||||||
run: sudo apt-get install ${{ matrix.extra-deps }}
|
apt-get -y install ${{ matrix.dependencies }}
|
||||||
|
|
||||||
- name: Package Bygfoot
|
- name: Package Bygfoot
|
||||||
run: ./scripts/package.sh .
|
id: package
|
||||||
|
run: |
|
||||||
|
tarname=bygfoot-${{ env.BYGFOOT_VERSION }}-${{ matrix.name }}
|
||||||
|
echo "::set-output name=tardir::$tarname"
|
||||||
|
echo "::set-output name=tarfile::$tarname.tar.bz2"
|
||||||
|
./scripts/package.sh . $tarname
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: "bygfoot-${{ env.BYGFOOT_VERSION }}-linux${{ matrix.build-suffix }}"
|
name: "bygfoot-${{ env.BYGFOOT_VERSION }}-${{ matrix.name }}"
|
||||||
path: "*.bz2"
|
path: "${{ steps.package.outputs.tarfile }}"
|
||||||
|
|
||||||
test-linux:
|
|
||||||
needs:
|
|
||||||
- package-linux
|
|
||||||
runs-on:
|
|
||||||
- ubuntu-16.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
|
if: ${{ github.event_name == 'pull_request' && matrix.test }}
|
||||||
with:
|
with:
|
||||||
name: "bygfoot-${{ env.BYGFOOT_VERSION }}-linux"
|
path: tests-${{ matrix.name }}
|
||||||
|
name: "bygfoot-${{ env.BYGFOOT_VERSION }}-${{ matrix.name }}"
|
||||||
- name: Unpack binary package
|
|
||||||
run: |
|
|
||||||
ls
|
|
||||||
tar -xjf bygfoot-${{ env.BYGFOOT_VERSION }}.tar.bz2
|
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
|
if: ${{ github.event_name == 'pull_request' && matrix.test }}
|
||||||
|
working-directory: tests-${{ matrix.name }}
|
||||||
run: |
|
run: |
|
||||||
bash ./test/test-load-save.sh ./bygfoot-${{ env.BYGFOOT_VERSION }}/bygfoot
|
tar -xjf ${{ steps.package.outputs.tarfile }}
|
||||||
bash ./test/test-country-defs.sh ./bygfoot-${{ env.BYGFOOT_VERSION }}/bygfoot || true
|
bash ../test/test-load-save.sh ${{ steps.package.outputs.tardir }}/bygfoot
|
||||||
|
bash ../test/test-country-defs.sh ${{ steps.package.outputs.tardir }}/bygfoot || true
|
||||||
|
|
||||||
|
|
||||||
package-windows:
|
package-windows:
|
||||||
|
needs:
|
||||||
|
- set-variables
|
||||||
runs-on:
|
runs-on:
|
||||||
- windows-2016
|
- windows-2016
|
||||||
|
env:
|
||||||
|
BYGFOOT_VERSION: ${{ needs.set-variables.outputs.bygfoot-version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -107,7 +152,7 @@ jobs:
|
||||||
# Add gtk+ directory to PATH so that cmake can find the correct zlib
|
# Add gtk+ directory to PATH so that cmake can find the correct zlib
|
||||||
# library.
|
# library.
|
||||||
export PATH=`pwd`/bin:$PATH
|
export PATH=`pwd`/bin:$PATH
|
||||||
./scripts/package.sh .
|
./scripts/package.sh . bygfoot-${{ env.BYGFOOT_VERSION }}-win64
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
|
@ -115,3 +160,38 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: "bygfoot-${{ env.BYGFOOT_VERSION }}-win64"
|
name: "bygfoot-${{ env.BYGFOOT_VERSION }}-win64"
|
||||||
path: "*.bz2"
|
path: "*.bz2"
|
||||||
|
|
||||||
|
create_release:
|
||||||
|
if: ${{ startswith(github.ref, 'refs/tags') }}
|
||||||
|
needs:
|
||||||
|
- package-linux
|
||||||
|
- package-windows
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
path: 'artifacts'
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: pip install PyGithub
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import github
|
||||||
|
import os
|
||||||
|
prerelease = False
|
||||||
|
tag = '${{ github.ref }}'.split('/')[-1]
|
||||||
|
if 'alpha' in tag or 'beta' in tag or 'rc' in tag:
|
||||||
|
prerelease = True
|
||||||
|
context = github.Github('${{ github.token }}')
|
||||||
|
repo = context.get_repo('${{ github.repository }}')
|
||||||
|
release = repo.create_git_release(tag = tag, name = tag, message = tag,
|
||||||
|
prerelease = prerelease)
|
||||||
|
for dir in os.listdir('artifacts'):
|
||||||
|
print(dir)
|
||||||
|
for f in os.listdir('artifacts' + '/' + dir):
|
||||||
|
print(f)
|
||||||
|
release.upload_asset('artifacts' + '/' + dir + '/' + f)
|
||||||
|
|
|
@ -140,12 +140,16 @@ add_executable(bygfoot WIN32
|
||||||
)
|
)
|
||||||
# Some gtk headers use deprecated glib features, so disable this warning
|
# Some gtk headers use deprecated glib features, so disable this warning
|
||||||
# since we can't do anything about it.
|
# since we can't do anything about it.
|
||||||
target_compile_options(bygfoot PRIVATE -Wno-deprecated-declarations)
|
# Newer versions of gcc and clang enable fno-common by default and
|
||||||
|
# this won't work with the global variables in bygfoot.
|
||||||
|
target_compile_options(bygfoot PRIVATE
|
||||||
|
-Wno-deprecated-declarations
|
||||||
|
-fcommon)
|
||||||
# Link the target to the GTK+ libraries
|
# Link the target to the GTK+ libraries
|
||||||
target_link_libraries (bygfoot ${GTK2_LIBRARIES} ${GLIB_LIBRARIES} m
|
target_link_libraries (bygfoot ${GTK2_LIBRARIES} ${GLIB_LIBRARIES} m
|
||||||
${ZLIB_LIBRARIES} ${JSON-C_LIBRARIES})
|
${ZLIB_LIBRARIES} ${JSON-C_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS bygfoot)
|
install(TARGETS bygfoot RUNTIME DESTINATION bin)
|
||||||
|
|
||||||
install(DIRECTORY support_files DESTINATION
|
install(DIRECTORY support_files DESTINATION
|
||||||
${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
|
${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
srcdir=$1
|
srcdir=`realpath $1`
|
||||||
|
|
||||||
version="2.3.3"
|
version="2.3.3"
|
||||||
|
|
||||||
|
@ -11,14 +11,28 @@ if [ -n "$BYGFOOT_VERSION" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
builddir=./build-$version
|
builddir=./build-$version
|
||||||
installdir=./bygfoot-$version
|
tarname=bygfoot-$version
|
||||||
|
|
||||||
|
if [ -n "$2" ]; then
|
||||||
|
installdir=$2
|
||||||
|
tarname=$2
|
||||||
|
fi
|
||||||
|
|
||||||
|
installdir=$tarname
|
||||||
|
installdir_abs=`realpath $installdir`
|
||||||
|
|
||||||
mkdir -p $builddir
|
mkdir -p $builddir
|
||||||
mkdir -p $installdir
|
mkdir -p $installdir
|
||||||
|
|
||||||
cmake -G Ninja -B $builddir -S $srcdir -DCMAKE_INSTALL_PREFIX=$installdir -DCMAKE_C_FLAGS=-DVERS=\"\\\"$version\\\"\"
|
# Don't use the -B option here, because some older versions of
|
||||||
|
# cmake don't support it.
|
||||||
|
pushd $builddir
|
||||||
|
cmake -G Ninja -S $srcdir -DCMAKE_INSTALL_PREFIX=$installdir_abs -DCMAKE_C_FLAGS=-DVERS=\"\\\"$version\\\"\"
|
||||||
|
popd
|
||||||
|
|
||||||
ninja -v -C $builddir install
|
ninja -v -C $builddir install
|
||||||
|
|
||||||
|
|
||||||
# Fixup install dir so that bygfoot can find the support
|
# Fixup install dir so that bygfoot can find the support
|
||||||
# files.
|
# files.
|
||||||
|
|
||||||
|
@ -36,5 +50,5 @@ for f in AUTHORS COPYING ChangeLog INSTALL README TODO UPDATE ReleaseNotes; do
|
||||||
cp $srcdir/$f $installdir/
|
cp $srcdir/$f $installdir/
|
||||||
done
|
done
|
||||||
|
|
||||||
tar -cjf bygfoot-$version.tar.bz2 $installdir
|
tar -cjf $tarname.tar.bz2 $installdir
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue