Skip to content

Update LICENSE

Update LICENSE #92

Workflow file for this run

name: Generate latest builds
on:
release:
types:
- created
push:
branches: ["master"]
pull_request:
branches: ["master", "dev*"]
jobs:
run_pytest:
name: HiCT Library autotests
continue-on-error: true
runs-on: [ "ubuntu-latest" ]
defaults:
run:
working-directory: ./HiCT_Library
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Python
uses: actions/[email protected]
with:
# Version range or exact version of Python or PyPy to use, using SemVer's version range syntax. Reads from .python-version if unset.
python-version: '>=3.9 <3.11'
# Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry.
cache: pip
# The target architecture (x86, x64) of the Python or PyPy interpreter.
architecture: x64
# Set this option if you want the action to update environment variables.
update-environment: true
cache-dependency-path: |
**/*requirements*.txt
- name: Install development dependencies
continue-on-error: true
run: pip install -r requirements-dev.txt
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Launch Tests
run: ./run_tests.sh
build_hict_library:
name: Build HiCT Library wheel
continue-on-error: true
runs-on: [ "ubuntu-latest" ]
defaults:
run:
working-directory: ./HiCT_Library
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Python
uses: actions/[email protected]
with:
# Version range or exact version of Python or PyPy to use, using SemVer's version range syntax. Reads from .python-version if unset.
python-version: '>=3.9 <3.11'
# Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry.
cache: pip
# The target architecture (x86, x64) of the Python or PyPy interpreter.
architecture: x64
# Set this option if you want the action to update environment variables.
update-environment: true
cache-dependency-path: |
**/*requirements*.txt
- name: Install dev dependencies
continue-on-error: true
run: pip install -r requirements-dev.txt
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run byte-compiler
run: python -m compileall -o 2 -r 10 -f -e .
continue-on-error: true
- name: Build HiCT_Library wheel
run: python setup.py bdist_wheel
- name: Upload wheel artifact
uses: actions/upload-artifact@v3
with:
name: HiCT_Library_wheel
path: |
**/dist/**/*.whl
build_hict_utils:
name: Build HiCT-based python tools (${{ matrix.tool_name }})
needs: [ "build_hict_library" ]
continue-on-error: true
strategy:
matrix:
include:
# - tool_name: "HiCT Server"
# tool_submodule: "HiCT_Server"
- tool_name: "HiCT Utils"
tool_submodule: "HiCT_Utils"
runs-on: [ "ubuntu-latest" ]
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Python
uses: actions/[email protected]
with:
# Version range or exact version of Python or PyPy to use, using SemVer's version range syntax. Reads from .python-version if unset.
python-version: '>=3.9 <3.11'
# Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry.
cache: pip
# The target architecture (x86, x64) of the Python or PyPy interpreter.
architecture: x64
# Set this option if you want the action to update environment variables.
update-environment: true
cache-dependency-path: |
**/*requirements*.txt
- name: Install ${{ matrix.tool_name }} build dependencies
continue-on-error: true
run: |
cd "${{ matrix.tool_submodule }}"
pip install -r requirements-dev.txt
- name: Load built HiCT_Library
uses: actions/download-artifact@v3
with:
name: HiCT_Library_wheel
path: ./artifacts/
- name: Install previously built HiCT library
run: |
find ./artifacts/ -type f -name "*.whl" -print0 | xargs -0 pip install
rm -rf ./artifacts
- name: Install ${{ matrix.tool_name }} dependencies
run: |
cd "${{ matrix.tool_submodule }}"
pip install -r requirements.txt
- name: Run byte-compiler
run: python -m compileall -o 2 -r 10 -f -e .
continue-on-error: true
- name: Build ${{ matrix.tool_name }} wheel
run: |
cd "${{ matrix.tool_submodule }}"
python setup.py bdist_wheel
- name: Upload wheel artifact
uses: actions/upload-artifact@v3
with:
name: "${{ matrix.tool_submodule }}_wheel"
path: |
./${{ matrix.tool_submodule }}/**/dist/**/*.whl
build_hict_server:
name: Build HiCT-based python tools (${{ matrix.tool_name }})
needs: [ "build_hict_utils" ]
continue-on-error: true
strategy:
matrix:
include:
- tool_name: "HiCT Server"
tool_submodule: "HiCT_Server"
# - tool_name: "HiCT Utils"
# tool_submodule: "HiCT_Utils"
runs-on: [ "ubuntu-latest" ]
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Python
uses: actions/[email protected]
with:
# Version range or exact version of Python or PyPy to use, using SemVer's version range syntax. Reads from .python-version if unset.
python-version: '>=3.9 <3.11'
# Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry.
cache: pip
# The target architecture (x86, x64) of the Python or PyPy interpreter.
architecture: x64
# Set this option if you want the action to update environment variables.
update-environment: true
cache-dependency-path: |
**/*requirements*.txt
- name: Install ${{ matrix.tool_name }} build dependencies
continue-on-error: true
run: |
cd "${{ matrix.tool_submodule }}"
pip install -r requirements-dev.txt
- name: Load built HiCT_Library
uses: actions/download-artifact@v3
with:
name: HiCT_Library_wheel
path: ./artifacts/
- name: Load built HiCT_Utils
uses: actions/download-artifact@v3
with:
name: HiCT_Utils_wheel
path: ./artifacts/
- name: Install previously built HiCT library and HiCT Utils
run: |
find ./artifacts/ -type f -name "*.whl" -print0 | xargs -0 pip install
rm -rf ./artifacts
- name: Install ${{ matrix.tool_name }} dependencies
run: |
cd "${{ matrix.tool_submodule }}"
pip install -r requirements.txt
- name: Run byte-compiler
run: python -m compileall -o 2 -r 10 -f -e .
continue-on-error: true
- name: Build ${{ matrix.tool_name }} wheel
run: |
cd "${{ matrix.tool_submodule }}"
python setup.py bdist_wheel
- name: Upload wheel artifact
uses: actions/upload-artifact@v3
with:
name: "${{ matrix.tool_submodule }}_wheel"
path: |
./${{ matrix.tool_submodule }}/**/dist/**/*.whl
build_web_ui:
strategy:
matrix:
include:
- os: "ubuntu-latest"
npm-task: "app:linuxbuild"
artifact-name: "linuxbuild"
- os: "windows-latest"
npm-task: "app:winbuild"
artifact-name: "winbuild"
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: 16
- name: Install dependencies
run: |
cd HiCT_WebUI
npm install
- name: Build electron app (linux)
run: |
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
cd HiCT_WebUI
npm run ${{ matrix.npm-task }}
if: runner.os == 'Linux'
- name: Build electron app (windows)
run: powershell "[Environment]::SetEnvironmentVariable('GH_TOKEN','${{ secrets.GITHUB_TOKEN }}','User'); cd HiCT_WebUI; npm run ${{ matrix.npm-task }}"
if: runner.os == 'Windows'
- name: Publish build artifacts
uses: actions/upload-artifact@v3
with:
name: hict_trunk_build_${{ matrix.artifact-name }}
path: |
**/release/**/*.AppImage
**/release/**/*.zip
**/release/**/*.exe
!**/*.yml
docker-HiCT_Server:
runs-on: "ubuntu-latest"
needs: [ "build_hict_server" ]
continue-on-error: true
permissions:
contents: read
packages: write
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- name: Extract branch name
id: branch-name
uses: tj-actions/branch-names@v6
- name: Load built HiCT_Library
uses: actions/download-artifact@v3
with:
name: HiCT_Library_wheel
path: ./build-context/
- name: Create directory for build context
run: mkdir -p ./build-context/docker/
continue-on-error: true
- name: Move all wheels to the build context directly
run: find ./build-context/ -type f -name "*.whl" -print0 | xargs -0 mv -t ./build-context/
- name: Copy HiCT_Server to build context
run: cp -rf ./HiCT_Server/ ./build-context/
- name: Copy Dockerfiles to build directory
run: cp -rf ./docker/server.Dockerfile ./build-context/docker/server.Dockerfile
- name: Show directory contents
run: ls -alRh ./build-context/
- name: Log into ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Build and publish a Docker image for HiCT_Server to ghcr.io
uses: macbre/push-to-ghcr@master
with:
image_name: "ctlab/hict-server"
github_token: ${{ secrets.GITHUB_TOKEN }}
image_tag: ${{ (steps.branch-name.outputs.current_branch == 'master') && 'latest' || steps.branch-name.outputs.current_branch }}
context: ./build-context/
dockerfile: ./build-context/docker/server.Dockerfile
continue-on-error: true
- name: Log into DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_LOGIN }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
continue-on-error: true
- name: Build and publish a Docker image for HiCT_Server to DockerHub mirror
uses: docker/build-push-action@v4
with:
push: true
tags: "squirrelfolding/hict-server:${{ (steps.branch-name.outputs.current_branch == 'master') && 'latest' || steps.branch-name.outputs.current_branch }}"
secrets: |
GIT_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}
context: ./build-context/
file: ./build-context/docker/server.Dockerfile
continue-on-error: true
docker-HiCT_WebUI:
runs-on: "ubuntu-latest"
continue-on-error: true
permissions:
contents: read
packages: write
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- name: Extract branch name
id: branch-name
uses: tj-actions/branch-names@v6
- name: Create directory for build context
run: mkdir -p ./build-context/docker/
continue-on-error: true
- name: Copy HiCT_WebUI to build context
run: cp -rf ./HiCT_WebUI/ ./build-context/
- name: Copy Dockerfiles to build directory
run: cp -rf ./docker/webui.Dockerfile ./build-context/docker/webui.Dockerfile
- name: Show directory contents
run: ls -alRh ./build-context/
- name: Log into ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Build and publish a Docker image for HiCT_WebUI to ghcr.io
uses: macbre/push-to-ghcr@master
with:
image_name: "ctlab/hict-webui"
github_token: ${{ secrets.GITHUB_TOKEN }}
image_tag: ${{ (steps.branch-name.outputs.current_branch == 'master') && 'latest' || steps.branch-name.outputs.current_branch }}
context: ./build-context/
dockerfile: ./build-context/docker/webui.Dockerfile
continue-on-error: true
- name: Log into DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_LOGIN }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
continue-on-error: true
- name: Build and publish a Docker image for HiCT_WebUI to DockerHub mirror
uses: docker/build-push-action@v4
with:
push: true
tags: "squirrelfolding/hict-webui:${{ (steps.branch-name.outputs.current_branch == 'master') && 'latest' || steps.branch-name.outputs.current_branch }}"
secrets: |
GIT_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}
context: ./build-context/
file: ./build-context/docker/webui.Dockerfile
continue-on-error: true
docker-full:
runs-on: "ubuntu-latest"
needs: [ "build_hict_server" ]
continue-on-error: true
permissions:
contents: read
packages: write
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- name: Extract branch name
id: branch-name
uses: tj-actions/branch-names@v6
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: 16
- name: Build web app
run: |
cd HiCT_WebUI
npm install
npm run build
cd ..
- name: Create directory for build context
run: |
mkdir -p ./build-context/docker/
mkdir -p ./build-context/dist/
mkdir -p ./build-context/dist/webui
continue-on-error: true
- name: Copy HiCT_WebUI to build context
run: cp -rf ./HiCT_WebUI/dist ./build-context/dist/webui
- name: Load built HiCT_Library
uses: actions/download-artifact@v3
with:
name: HiCT_Library_wheel
path: ./build-context/
- name: Load built HiCT_Utils
uses: actions/download-artifact@v3
with:
name: HiCT_Utils_wheel
path: ./build-context/
- name: Move all wheels to the build context directly
run: find ./build-context/ -type f -name "*.whl" -print0 | xargs -0 mv -t ./build-context/dist/
continue-on-error: true
- name: Copy HiCT_Server to build context
run: cp -rf ./HiCT_Server/ ./build-context/
- name: Copy Dockerfile to build directory
run: cp -rf ./docker/full.Dockerfile ./build-context/docker/full.Dockerfile
- name: Copy NGINX config
run: cp -rf ./docker/nginx.conf ./build-context/docker/nginx.conf
- name: Show directory contents
run: ls -alRh ./build-context/
- name: Log into ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Build and publish a Docker image for HiCT_WebUI to ghcr.io
uses: macbre/push-to-ghcr@master
with:
image_name: "ctlab/hict-full"
github_token: ${{ secrets.GITHUB_TOKEN }}
image_tag: ${{ (steps.branch-name.outputs.current_branch == 'master') && 'latest' || steps.branch-name.outputs.current_branch }}
context: ./build-context/
dockerfile: ./build-context/docker/full.Dockerfile
continue-on-error: true
- name: Log into DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_LOGIN }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
continue-on-error: true
- name: Build and publish a Docker image for HiCT_WebUI to DockerHub mirror
uses: docker/build-push-action@v4
with:
push: true
tags: "squirrelfolding/hict-full:${{ (steps.branch-name.outputs.current_branch == 'master') && 'latest' || steps.branch-name.outputs.current_branch }}"
secrets: |
GIT_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}
context: ./build-context/
file: ./build-context/docker/full.Dockerfile
continue-on-error: true
release:
runs-on: "ubuntu-latest"
needs: [ "build_hict_library", "build_hict_utils", "build_hict_server", "build_web_ui", "docker-full" ]
steps:
- name: Download linux release
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: hict_trunk_build_linuxbuild
- name: Download windows release
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: hict_trunk_build_winbuild
- name: Download HiCT_Library release
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: HiCT_Library_wheel
- name: Download HiCT_Server release
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: HiCT_Server_wheel
- name: Download HiCT_Utils release
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: HiCT_Utils_wheel
- name: Generate latest release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: "Latest autogenerated build"
files: |
**/*HiCT*.zip
**/*HiCT*.exe
**/*HiCT*.AppImage
**/*HiCT*.whl
**/*hict*.zip
**/*hict*.exe
**/*hict*.AppImage
**/*hict*.whl