Skip to content

Fix missing charset_normalizer dependency #57

Fix missing charset_normalizer dependency

Fix missing charset_normalizer dependency #57

Workflow file for this run

name: Build
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
build-envs:
name: Build Conda Environments
strategy:
matrix:
os: [
windows-latest,
ubuntu-latest,
macos-latest
]
runs-on: ${{ matrix.os }}
steps:
- name: Check out Repository
uses: actions/checkout@v3
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.2.0
with:
miniconda-version: "latest"
python-version: 3.10.11
- name: Create and Package Conda Environment (Darwin/Linux)
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash -l {0}
run: |
conda config --set channel_priority strict
conda env create -f src/environment.yml --name build_env
conda activate build_env
conda-pack --ignore-missing-files -o env-${{ matrix.os }}.tar.gz
- name: Create and Package Conda Environment (Windows)
if: runner.os == 'Windows'
shell: cmd /C call {0}
run: >-
conda config --set channel_priority strict
&& conda env create -f src/environment.yml --name build_env
&& conda activate build_env
&& conda-pack --ignore-missing-files -o env-${{ matrix.os }}.tar.gz
- name: Upload environment archive
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-env
path: env-${{ matrix.os }}.tar.gz
create-rel:
name: Create Release
needs: build-envs
runs-on: ubuntu-latest
outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create a Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
# The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag
tag_name: ${{ github.ref }}
# The name of the release. For example, `Release v1.0.1`
release_name: Release ${{ github.ref }}
# Text describing the contents of the tag.
body: Release Autonomously Generated By CI on Pushed Tag
# `true` to create a draft (unpublished) release, `false` to create a published one. Default: `false`
draft: false # optional
# `true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`
prerelease: false # optional
build-dist:
name: Build Module Archive
needs: create-rel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Zip
uses: montudor/action-zip@v1
- name: Zip Package Sources and Env
run: |
cd src
mv ../LICENSE .
mv ../NOTICE .
zip -qq -r ../PresidioDeidentificationForOHNLPTK.zip .
cd ..
- name: Create Directory Structure for Release
shell: bash
run: |
mkdir dist
mkdir dist/python_modules
mv ./PresidioDeidentificationForOHNLPTK.zip dist/python_modules/PresidioDeidentificationForOHNLPTK.zip
mv ./resources dist/python_resources
- name: Zip Package Dist for Final Release (Online/Compact)
run: |
cd dist
zip -qq -r ../PresidioDeidentificationForOHNLPTK.zip .
cd ..
- name: Upload Release Asset (Online/Compact)
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.create-rel.outputs.release_upload_url }}
asset_path: ./PresidioDeidentificationForOHNLPTK.zip
asset_name: PresidioDeidentificationForOHNLPTK.zip
asset_content_type: application/zip
build-dist-standalone:
name: Build Module Archive (Standalone)
needs: create-rel
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [
windows,
ubuntu,
macos
]
include:
- os: windows
dist_name: win32
- os: ubuntu
dist_name: linux
- os: macos
dist_name: darwin
env:
OS_NAME: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Zip
uses: montudor/action-zip@v1
- name: Download runner/ubuntu env file
uses: actions/download-artifact@v3
with:
name: ubuntu-latest-env
- name: Download dist env file
if: matrix.os != 'ubuntu'
uses: actions/download-artifact@v3
with:
name: ${{ matrix.os }}-latest-env
- name: Rename dist env files
shell: bash
run: |
mkdir python_envs
mkdir python_envs/${{ matrix.dist_name }}
mv env-${{ matrix.os }}-latest.tar.gz python_envs/${{ matrix.dist_name }}/PresidioDeidentificationforOHNLPTK.tar.gz
- name: Rename runner env file
if: matrix.os != 'ubuntu'
shell: bash
run: |
mkdir python_envs/linux
mv env-ubuntu-latest.tar.gz python_envs/linux/PresidioDeidentificationforOHNLPTK.tar.gz
- name: Zip Package Sources and Env
run: |
cd src
zip -qq -r ../PresidioDeidentificationForOHNLPTK.zip .
cd ..
- name: Unpack Environment to Execute Build Script
shell: bash -l {0}
run: |
mkdir build_env
tar -xzf python_envs/linux/PresidioDeidentificationforOHNLPTK.tar.gz -C build_env
source build_env/bin/activate
conda-unpack
python src/build.py
- name: Create Directory Structure for Release
shell: bash
run: |
mkdir dist
mkdir dist/python_modules
mv ./resources dist/python_resources
mv ./python_envs dist/python_envs
mv ./obi_deid_roberta_i2b2 ./dist/python_resources/obi_deid_roberta_i2b2
mv ./PresidioDeidentificationForOHNLPTK.zip dist/python_modules/PresidioDeidentificationForOHNLPTK.zip
- name: Zip Package Dist for Final Release (Online/Compact)
run: |
cd dist
zip -qq -r ../PresidioDeidentificationForOHNLPTK.zip .
cd ..
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.create-rel.outputs.release_upload_url }}
asset_path: ./PresidioDeidentificationForOHNLPTK.zip
asset_name: PresidioDeidentificationForOHNLPTK-Standalone-${{ matrix.dist_name }}.zip
asset_content_type: application/zip