v2.8.1 #67
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Release new CLI version | |
# When a new release is made, this action will be run. | |
# The action builds the CLI and publishes to PyPi, | |
# and generates the executables for Windows, MacOS and Ubuntu. | |
# It also builds the documentation and generates a PDF version of it. | |
--- | |
name: New Release | |
on: | |
release: | |
types: [published] | |
branches: | |
- "master" | |
jobs: | |
build-n-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: Check out source-code repository | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install . | |
- name: Build the distribution | |
run: python setup.py sdist bdist_wheel | |
- name: Publish dist to TestPyPI | |
if: github.repository == 'ScilifelabDataCentre/dds_cli' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
print-hash: true | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true | |
- name: Publish dist to PyPI | |
if: github.repository == 'ScilifelabDataCentre/dds_cli' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
print-hash: true | |
user: __token__ | |
password: ${{ secrets.pypi_password }} | |
skip-existing: true | |
ddsclibinaries: | |
name: Build binary packages for the DDS CLI | |
needs: build-n-publish | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-13 | |
TARGET: MacOs_x86_64 | |
CMD_BUILD: > | |
pyinstaller -F -c -n dds_cli_macos_x86_64 -i resources/scilifelab.icns | |
--exclude-module=tests --target-arch x86_64 --log-level INFO dds_cli/__init__.py | |
OUT_FILE_NAME: dds_cli_macos_x86_64 | |
ASSET_MIME: application/x-elf | |
# - os: macos-latest #No virtual environment for this yet | |
# TARGET: MacOs_arm64 | |
# CMD_BUILD: > | |
# pyinstaller -F -c -n dds_cli_macos_arm64 -i resources/scilifelab.icns | |
# --exclude-module=tests --target-arch arm64 --log-level INFO dds_cli/__init__.py | |
# OUT_FILE_NAME: dds_cli_macos_arm64 | |
# ASSET_MIME: application/x-elf | |
- os: windows-latest | |
TARGET: Windows_x86_64 | |
CMD_BUILD: > | |
PyInstaller -F -c -n dds_cli_win_x86_64.exe -i resources/scilifelab.ico | |
--exclude-module=tests --log-level INFO dds_cli/__init__.py | |
OUT_FILE_NAME: dds_cli_win_x86_64.exe | |
ASSET_MIME: application/vnd.microsoft.portable-executable | |
- os: ubuntu-20.04 | |
TARGET: Linux_x86_64 | |
CMD_BUILD: > | |
pyinstaller -F -c -n dds_cli_ubuntu-20.04_x86_64 -i resources/scilifelab.icns | |
--exclude-module=tests --target-arch x86_64 --log-level INFO dds_cli/__init__.py | |
OUT_FILE_NAME: dds_cli_ubuntu-20.04_x86_64 | |
ASSET_MIME: application/x-elf | |
- os: ubuntu-latest # ubuntu-22.04 at the moment | |
TARGET: Linux_x86_64 | |
CMD_BUILD: > | |
pyinstaller -F -c -n dds_cli_ubuntu-latest_x86_64 -i resources/scilifelab.icns | |
--exclude-module=tests --target-arch x86_64 --log-level INFO dds_cli/__init__.py | |
OUT_FILE_NAME: dds_cli_ubuntu-latest_x86_64 | |
ASSET_MIME: application/x-elf | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Python 3.9 setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
# architecture: 'x64' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install PyInstaller | |
pip install -r requirements.txt | |
- name: Building with PyInstaller for ${{matrix.TARGET}} | |
run: ${{matrix.CMD_BUILD}} | |
- name: Test the executable | |
run: | | |
./dist/${{ matrix.OUT_FILE_NAME}} --version | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./dist/${{ matrix.OUT_FILE_NAME}} | |
asset_name: ${{ matrix.OUT_FILE_NAME}} | |
asset_content_type: ${{ matrix.ASSET_MIME}} | |
ddsclidocumentation: | |
name: Build the DDS CLI Documentation | |
needs: build-n-publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Make dependencies available to Docker container | |
run: | | |
cat requirements.txt requirements-dev.txt > ./docs/requirements.txt | |
- name: Build the HTML documentation | |
uses: matthiaszepper/sphinx-action-v4@latest | |
with: | |
container: latest | |
pre-build-command: "apt-get update && apt-get install -y gcc && pip install ." | |
build-command: "make html" | |
docs-folder: "docs/" | |
- name: Build the pdf with Sphinx | |
uses: matthiaszepper/sphinx-action-v4@pdflatex | |
with: | |
container: pdflatex | |
pre-build-command: "apt-get update && apt-get install -y librsvg2-bin && apt-get -y install build-essential" | |
build-command: "make latexpdf" | |
docs-folder: "docs/" | |
- name: Create an artifact of the previously built HTML | |
uses: actions/upload-artifact@v3 | |
with: | |
name: DocumentationHTML | |
path: docs/_build/html/ | |
- name: Create an artifact of the previously built pdf | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Documentation | |
path: docs/_build/latex/datadeliverysystem.pdf | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: docs/_build/latex/datadeliverysystem.pdf | |
asset_name: dds_cli_user_manual.pdf | |
asset_content_type: application/pdf |