inkstitch/.github/workflows/build.yml

210 wiersze
6.3 KiB
YAML
Czysty Zwykły widok Historia

2019-11-15 18:09:53 +00:00
name: Build
2019-11-24 01:02:31 +00:00
on:
push:
branches-ignore:
- master
tags:
- "v*"
2019-11-15 18:09:53 +00:00
jobs:
2020-01-12 02:54:56 +00:00
linux:
2020-01-12 03:26:27 +00:00
runs-on: ubuntu-16.04
2020-01-12 02:54:56 +00:00
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- uses: actions/setup-python@v1
with:
python-version: '2.7.x'
architecture: 'x64'
- name: download dependencies
shell: bash
run: |
curl -sOL https://inkscape.org/en/gallery/item/12187/inkscape-0.92.3.tar.bz2
- name: install dependencies
shell: bash
run: |
sudo apt-get install gettext
# for shapely
sudo apt-get install libgeos-dev
# for wxPython
2020-01-13 03:17:25 +00:00
sudo apt-get install glib-networking libsdl1.2-dev
2020-01-12 02:54:56 +00:00
# for PyGObject
sudo apt install libgirepository1.0-dev
2020-01-27 16:45:49 +00:00
uname -a
python --version
2020-01-27 19:10:45 +00:00
pip --version
pip debug
2020-01-27 16:45:49 +00:00
2020-01-27 17:46:51 +00:00
python -m pip install --upgrade pip
2020-01-12 02:54:56 +00:00
# wxPython doen't publish linux wheels in pypi
2020-01-13 03:17:25 +00:00
wget -q https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04/wxPython-4.0.6-cp27-cp27mu-linux_x86_64.whl
2020-01-27 17:28:18 +00:00
python -m pip install wxPython*.whl
2020-01-12 02:54:56 +00:00
# We can't use the shapely wheel because it includes the geos
# library but with a weird file name. Details:
# https://github.com/pyinstaller/pyinstaller/blob/61b1c75c2b0469b32d114298a63bf60b8d597e37/PyInstaller/hooks/hook-shapely.py#L34
2020-01-27 17:28:18 +00:00
python -m pip install --no-binary shapely -r requirements.txt
2020-01-12 02:54:56 +00:00
2020-01-27 17:28:18 +00:00
python -m pip install PyGObject
2020-01-12 02:54:56 +00:00
2020-01-27 17:28:18 +00:00
python -m pip install -r requirements.txt
python -m pip install pyinstaller==3.3.1
2020-01-12 02:54:56 +00:00
tar -jxf inkscape-0.92.3.tar.bz2
rm inkscape-0.92.3.tar.bz2
mv inkscape-0.92.3 inkscape
echo "::add-path::${{ env.pythonLocation }}\bin"
- shell: bash
run: |
make dist
env:
BUILD: linux
- uses: actions/upload-artifact@master
with:
name: inkstitch-linux
path: artifacts
2019-11-15 18:09:53 +00:00
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- uses: actions/setup-python@v1
with:
python-version: '2.7.x'
architecture: 'x86'
- name: download dependencies
shell: bash
run: |
curl -sOL https://github.com/lexelby/inkstitch-build-objects/releases/download/v1.0.0/Shapely-1.6.3-cp27-cp27m-win32.whl
curl -sOL https://inkscape.org/en/gallery/item/12187/inkscape-0.92.3.tar.bz2
- name: install dependencies
shell: bash
run: |
pip install Shapely-1.6.3-cp27-cp27m-win32.whl
pip install -r requirements.txt
pip install pyinstaller==3.3.1
2020-01-27 19:14:39 +00:00
echo "before tar"
2019-11-15 18:09:53 +00:00
tar -jxf inkscape-0.92.3.tar.bz2
2020-01-27 19:14:39 +00:00
echo "after tar"
2019-11-15 18:09:53 +00:00
rm inkscape-0.92.3.tar.bz2
mv inkscape-0.92.3 inkscape
echo "::add-path::${{ env.pythonLocation }}\bin"
- name: fix geos
shell: bash
run: |
cd "${{ env.pythonLocation }}\Lib/site-packages/shapely/DLLs"
cp geos_c.dll geos.dll
- shell: bash
run: |
make dist
env:
BUILD: windows
- uses: actions/upload-artifact@master
with:
name: inkstitch-windows
path: artifacts
2019-12-19 20:42:27 +00:00
mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- uses: actions/setup-python@v1
with:
python-version: '2.7.x'
- name: download inkscape
shell: bash
run: |
2019-12-20 03:35:58 +00:00
curl -sOL https://inkscape.org/en/gallery/item/12187/inkscape-0.92.3.tar.bz2
2019-12-19 20:42:27 +00:00
- name: install dependencies
shell: bash
run: |
2019-12-20 03:35:58 +00:00
brew update
2020-01-05 01:13:47 +00:00
# this errors because it installs python3 but python2 is already installed
2020-01-05 01:19:41 +00:00
brew install gtk+3 pkg-config gobject-introspection libffi || true
2019-12-20 03:35:58 +00:00
2020-01-05 01:19:41 +00:00
export LDFLAGS="-L/usr/local/opt/libffi/lib"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
2019-12-20 03:35:58 +00:00
# for msgfmt
brew link gettext --force
echo "::set-env name=GI_TYPELIB_PATH::/usr/local/lib/girepository-1.0/"
2020-01-04 22:42:35 +00:00
pip --version
pip install PyGObject
2019-12-19 20:42:27 +00:00
pip install -r requirements.txt
pip install pyinstaller==3.3.1
tar -jxf inkscape-0.92.3.tar.bz2
rm inkscape-0.92.3.tar.bz2
mv inkscape-0.92.3 inkscape
echo "::add-path::${{ env.pythonLocation }}\bin"
- shell: bash
run: |
make dist
env:
BUILD: osx
- uses: actions/upload-artifact@master
with:
name: inkstitch-mac
path: artifacts
release:
runs-on: ubuntu-latest
2020-01-12 02:54:56 +00:00
needs: [linux, windows, mac]
2019-12-19 20:42:27 +00:00
if: always()
steps:
2019-11-24 01:02:31 +00:00
- name: determine release info
2019-11-19 02:53:15 +00:00
shell: bash
run: |
2019-11-24 01:02:31 +00:00
if [[ "${GITHUB_REF}" =~ ^v[0-9.]+$ ]]; then
echo "::set-env name=release_tag::${GITHUB_REF}"
echo "::set-env name=prerelease::false"
echo "::set-env name=title::${GITHUB_REF}"
else
branch="${GITHUB_REF#refs/heads/}"
tag="dev-build-$(echo $branch | tr / -)"
echo "::set-env name=release_tag::${tag}"
echo "::set-env name=prerelease::true"
echo "::set-env name=title::development build of $branch"
2019-12-19 20:42:27 +00:00
fi
2020-01-12 02:54:56 +00:00
- name: download linux
uses: actions/download-artifact@v1
with:
name: 'inkstitch-linux'
path: 'artifacts/'
2019-12-20 04:19:38 +00:00
- name: download windows
2019-12-19 20:42:27 +00:00
uses: actions/download-artifact@v1
with:
2019-12-20 04:19:38 +00:00
name: 'inkstitch-windows'
2019-12-19 20:42:27 +00:00
path: 'artifacts/'
2020-01-12 02:54:56 +00:00
if: always()
2019-12-20 04:19:38 +00:00
- name: download mac
uses: actions/download-artifact@v1
with:
name: 'inkstitch-mac'
path: 'artifacts/'
if: always()
2019-11-24 01:02:31 +00:00
- name: create/update release
2019-12-19 20:22:30 +00:00
uses: "marvinpinto/action-automatic-releases@latest"
if: always()
2019-11-24 01:02:31 +00:00
with:
repo_token: "${{secrets.GITHUB_TOKEN}}"
automatic_release_tag: "${{env.release_tag}}"
prerelease: "${{env.prerelease}}"
title: "${{env.title}}"
files: |
artifacts/*.zip