Merge branch 'release/0.3.18' #112
This file contains hidden or 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
name: Release | |
on: | |
push: | |
branches: | |
- "master" | |
jobs: | |
check-version: | |
name: Check Version | |
runs-on: ubuntu-20.04 | |
outputs: | |
local-version: ${{ steps.get-local-version.outputs.version }} | |
remote-version-tensorneko: ${{ steps.get-remote-version-tensorneko.outputs.tensorneko-version }} | |
remote-version-tensorneko-util: ${{ steps.get-remote-version-tensorneko-util.outputs.tensorneko-util-version }} | |
remote-version-tensorneko-lib: ${{ steps.get-remote-version-tensorneko-lib.outputs.tensorneko-lib-version }} | |
remote-version-tensorneko-tool: ${{ steps.get-remote-version-tensorneko-tool.outputs.tensorneko-tool-version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Local Version | |
id: get-local-version | |
run: echo "version=$(cat version.txt)" >> $GITHUB_OUTPUT | |
- name: Get Remote Version Tensorneko | |
id: get-remote-version-tensorneko | |
run: echo "version=$(curl -s https://pypi.org/pypi/tensorneko/json | jq -r '.info.version')" >> $GITHUB_OUTPUT | |
- name: Get Remote Version Tensorneko Util | |
id: get-remote-version-tensorneko-util | |
run: echo "version=$(curl -s https://pypi.org/pypi/tensorneko_util/json | jq -r '.info.version')" >> $GITHUB_OUTPUT | |
- name: Get Remote Version Tensorneko Lib | |
id: get-remote-version-tensorneko-lib | |
run: echo "version=$(curl -s https://pypi.org/pypi/tensorneko_lib/json | jq -r '.info.version')" >> $GITHUB_OUTPUT | |
- name: Get Remote Version Tensorneko Tool | |
id: get-remote-version-tensorneko-tool | |
run: echo "version=$(curl -s https://pypi.org/pypi/tensorneko_tool/json | jq -r '.info.version')" >> $GITHUB_OUTPUT | |
build-web: | |
name: Build Web | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16.x | |
- name: npm install and build | |
working-directory: ./src/tensorneko_util/visualization/watcher/web | |
run: | | |
npm install | |
npm run build | |
env: | |
CI: true | |
- name: Print dist path | |
working-directory: ./src/tensorneko_util/visualization/watcher/web | |
run: | | |
echo ----------dist------- | |
ls -l dist | |
echo ----------dist/assets------- | |
ls -l dist/assets | |
unittest: | |
name: Unittest | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
torch-version: ["1.9.*", "1.10.*", "1.11.*", "1.12.*", "1.13.*", "2.0.*", "2.1.*", "2.2.*"] | |
lightning-version: ["2.0.*", "2.1.*", "2.2.*"] | |
exclude: | |
- python-version: "3.10" | |
torch-version: "1.8.*" | |
- python-version: "3.10" | |
torch-version: "1.9.*" | |
- python-version: "3.10" | |
torch-version: "1.10.*" | |
- python-version: "3.11" | |
torch-version: "1.8.*" | |
- python-version: "3.11" | |
torch-version: "1.9.*" | |
- python-version: "3.11" | |
torch-version: "1.10.*" | |
- python-version: "3.11" | |
torch-version: "1.11.*" | |
- python-version: "3.11" | |
torch-version: "1.12.*" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Install dependencies | |
run: | | |
pip install torch==${{ matrix.torch-version }} | |
pip install lightning==${{ matrix.lightning-version }} | |
pip install -r requirements_test.txt | |
python init.py | |
- name: Set PYTHONPATH | |
run: echo "PYTHONPATH=$(pwd)/src" >> $GITHUB_ENV | |
- name: Run Test | |
run: python -m unittest discover test | |
release-tensorneko: | |
name: Release Tensorneko | |
needs: [build-web, unittest, check-version] | |
if: needs.check-version.outputs.local-version != needs.check-version.outputs.remote-version-tensorneko | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install wheel | |
python init.py | |
- name: Build package for tensorneko | |
run: python setup.py sdist bdist_wheel | |
- name: Save to artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tensorneko | |
path: dist/ | |
- name: Release tensorneko to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
release-tensorneko-util: | |
name: Release Tensorneko Util | |
needs: [build-web, unittest, check-version] | |
if: needs.check-version.outputs.local-version != needs.check-version.outputs.remote-version-tensorneko-util | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16.x | |
- name: npm install and build | |
working-directory: ./src/tensorneko_util/visualization/watcher/web | |
run: | | |
npm install | |
npm run build | |
env: | |
CI: true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install wheel | |
python init.py | |
- name: Build package for tensorneko_util | |
run: python setup_util.py sdist bdist_wheel | |
- name: Save to artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tensorneko-util | |
path: dist/ | |
- name: Release tensorneko_util to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_UTIL_API_TOKEN }} | |
release-tensorneko-lib: | |
name: Release Tensorneko Lib | |
needs: [check-version] | |
if: needs.check-version.outputs.local-version != needs.check-version.outputs.remote-version-tensorneko-lib | |
uses: ./.github/workflows/release-lib.yml | |
secrets: | |
PYPI_API_TOKEN: ${{ secrets.PYPI_LIB_API_TOKEN }} | |
release-tensorneko-tool: | |
name: Release Tensorneko Tool | |
needs: [build-web, unittest, check-version] | |
if: needs.check-version.outputs.local-version != needs.check-version.outputs.remote-version-tensorneko-tool | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install wheel | |
python init.py | |
- name: Build package for tensorneko_tool | |
run: python setup_tool.py sdist bdist_wheel | |
- name: Save to artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tensorneko-tool | |
path: dist/ | |
- name: Release tensorneko_tool to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOOL_API_TOKEN }} | |
github-release: | |
name: Release | |
needs: [release-tensorneko, release-tensorneko-util, release-tensorneko-lib, release-tensorneko-tool] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Get the version | |
run: | | |
VER=$(cat version.txt) | |
echo "VERSION=$VER" >> $GITHUB_ENV | |
- name: Download artifacts tensorneko | |
uses: actions/download-artifact@v4 | |
with: | |
name: tensorneko | |
path: dist_tensorneko/ | |
- name: Download artifacts tensorneko-util | |
uses: actions/download-artifact@v4 | |
with: | |
name: tensorneko-util | |
path: dist_tensorneko_util/ | |
- name: Download artifacts tensorneko-lib | |
uses: actions/download-artifact@v4 | |
with: | |
name: tensorneko-lib | |
path: dist_tensorneko_lib/ | |
- name: Download artifacts tensorneko-tool | |
uses: actions/download-artifact@v4 | |
with: | |
name: tensorneko-tool | |
path: dist_tensorneko_tool/ | |
- name: Merge the artifacts | |
run: | | |
mkdir dist | |
cp -r dist_tensorneko/* dist/ | |
cp -r dist_tensorneko_util/* dist/ | |
cp -r dist_tensorneko_lib/* dist/ | |
cp -r dist_tensorneko_tool/* dist/ | |
- name: Release to GitHub Release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ env.VERSION }}" | |
title: "[${{ env.VERSION }}] TensorNeko Release" | |
prerelease: false | |
files: "dist/*" | |
draft: true |