Skip to content

Commit

Permalink
Setup for multiple os setup
Browse files Browse the repository at this point in the history
  • Loading branch information
white-gecko committed Aug 17, 2021
1 parent 1218855 commit d71b7ba
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 42 deletions.
111 changes: 72 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Run Tests and Build Quit Store Releases
on: [push]

jobs:
build:
test:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -57,36 +57,78 @@ jobs:
run: |
coverage report -m
coveralls
- name: Prepare Deployment
if: startsWith(github.ref, 'refs/tags/') && matrix.python == '3.9'
run: |
mkdir dist
# Linux 64bit
docker run -v "${{ github.workspace }}:/src/" ghcr.io/white-gecko/docker-pyinstaller:master-py3-amd64
cp dist/linux/run dist/quit-64bit-linux
# Linux 32bit, requires libgit2 from source, as no wheel is available on pypi
docker run -v "${{ github.workspace }}:/src/" --entrypoint /bin/sh ghcr.io/white-gecko/docker-pyinstaller:master-py3-i386 -c ". /root/.bashrc && pip install --no-deps --only-binary :all: pygit2 || { apt-get update -y && apt-get install -y cmake && /src/scripts/install-libgit2.sh; } && /entrypoint.sh"
cp dist/linux/run dist/quit-32bit-linux
# Windows
git apply requirements.txt.windows.patch
# Windows 64bit
docker run -v "${{ github.workspace }}:/src/" --entrypoint /bin/sh ghcr.io/white-gecko/docker-pyinstaller:master-py3-win64 -c "apt-get update -y && apt-get install -y git && git clone https://github.com/rdflib/rdflib /wine/drive_c/rdflib && pip install -e /wine/drive_c/rdflib && git clone https://github.com/RDFLib/rdflib-jsonld /wine/drive_c/rdflib-jsonld && pip install -e /wine/drive_c/rdflib-jsonld && /entrypoint.sh"
cp dist/windows/run.exe dist/quit-64bit-windows.exe
# Windows 32bit
docker run -v "${{ github.workspace }}:/src/" --entrypoint /bin/sh ghcr.io/white-gecko/docker-pyinstaller:master-py3-win32 -c "apt-get update -y && apt-get install -y git && git clone https://github.com/rdflib/rdflib /wine/drive_c/rdflib && pip install -e /wine/drive_c/rdflib && git clone https://github.com/RDFLib/rdflib-jsonld /wine/drive_c/rdflib-jsonld && pip install -e /wine/drive_c/rdflib-jsonld && /entrypoint.sh"
cp dist/windows/run.exe dist/quit-32bit-windows.exe
- name: Deploy 馃殌
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && matrix.python == '3.9'
with:
files: |
dist/quit-64bit-linux
dist/quit-32bit-linux
dist/quit-64bit-windows.exe
dist/quit-32bit-windows.exe
release:
runs-on: ${{ matrix.os }}
needs: test
#if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
python-version: [3.9]
os: ['windows-latest', 'ubuntu-latest', 'macos-latest']
fail-fast: false
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install apt packages
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update -qq
sudo apt-get install -qq \
- name: Patch Windows requirements
if: startsWith(matrix.os, 'windows')
run: |
git apply requirements.txt.windows.patch
- name: Set up environment
run: |
# Update pip
python -m pip install -U pip setuptools wheel
# Install dependencies
pip install --progress-bar=off -U -r requirements.txt
# Install PyInstaller
pip install --progress-bar=off pyinstaller
# Run PyInstaller
python -m pyinstaller --clean -y --dist ./dist/${{ matrix.os }} --workpath /tmp *.spec
cp ./dist/${{ matrix.os }}/run ./dist/quit-${{ matrix.os }} || cp ./dist/${{ matrix.os }}/run.exe ./dist/quit-${{ matrix.os }}.exe
#- name: Prepare Deployment
# run: |
# mkdir dist
# # Linux 64bit
# docker run -v "${{ github.workspace }}:/src/" ghcr.io/white-gecko/docker-pyinstaller:master-py3-amd64
# cp dist/linux/run dist/quit-64bit-linux
# # Linux 32bit, requires libgit2 from source, as no wheel is available on pypi
# docker run -v "${{ github.workspace }}:/src/" --entrypoint /bin/sh ghcr.io/white-gecko/docker-pyinstaller:master-py3-i386 -c ". /root/.bashrc && pip install --no-deps --only-binary :all: pygit2 || { apt-get update -y && apt-get install -y cmake && /src/scripts/install-libgit2.sh; } && /entrypoint.sh"
# cp dist/linux/run dist/quit-32bit-linux
# # Windows
# git apply requirements.txt.windows.patch
# # Windows 64bit
# docker run -v "${{ github.workspace }}:/src/" --entrypoint /bin/sh ghcr.io/white-gecko/docker-pyinstaller:master-py3-win64 -c "apt-get update -y && apt-get install -y git && git clone https://github.com/rdflib/rdflib /wine/drive_c/rdflib && pip install -e /wine/drive_c/rdflib && git clone https://github.com/RDFLib/rdflib-jsonld /wine/drive_c/rdflib-jsonld && pip install -e /wine/drive_c/rdflib-jsonld && /entrypoint.sh"
# cp dist/windows/run.exe dist/quit-64bit-windows.exe
# # Windows 32bit
# docker run -v "${{ github.workspace }}:/src/" --entrypoint /bin/sh ghcr.io/white-gecko/docker-pyinstaller:master-py3-win32 -c "apt-get update -y && apt-get install -y git && git clone https://github.com/rdflib/rdflib /wine/drive_c/rdflib && pip install -e /wine/drive_c/rdflib && git clone https://github.com/RDFLib/rdflib-jsonld /wine/drive_c/rdflib-jsonld && pip install -e /wine/drive_c/rdflib-jsonld && /entrypoint.sh"
# cp dist/windows/run.exe dist/quit-32bit-windows.exe
- name: Release 馃殌
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/quit-64bit-linux
dist/quit-32bit-linux
dist/quit-64bit-windows.exe
dist/quit-32bit-windows.exe
docker:
runs-on: ubuntu-latest
needs: test
steps:
-
name: Set up QEMU
Expand Down Expand Up @@ -115,23 +157,14 @@ jobs:
images: |
aksw/quitstore
ghcr.io/aksw/quitstore
-
name: Build and push only for amd64 and i386
id: docker_build_not_tagged
if: ${{!startsWith(github.ref, 'refs/tags/')}}
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/386,linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
-
name: Build and push for many architectures
id: docker_build_tagged
if: ${{startsWith(github.ref, 'refs/tags/')}}
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
cache-from: type=registry,ref=aksw/quitstore:latest
cache-to: type=inline
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
6 changes: 3 additions & 3 deletions requirements.txt.windows.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ index fccdc79..57d340f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,10 +1,7 @@
-git+https://github.com/RDFLib/rdflib@master#egg=rdflib
git+https://github.com/RDFLib/rdflib@master#egg=rdflib
Flask
Flask-Cors
pygit2>=1.1.0
sortedcontainers
uritools
-git+https://github.com/RDFLib/rdflib-jsonld@master
git+https://github.com/RDFLib/rdflib-jsonld@master

-uwsgi
pylava

0 comments on commit d71b7ba

Please sign in to comment.