-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
266 additions
and
23 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
name: test-and-deploy | ||
|
||
on: | ||
push: | ||
branches: [ dev ] | ||
paths-ignore: | ||
- '**.md' | ||
- '**.txt' | ||
|
||
concurrency: | ||
# subsequently queued workflow run will interrupt previous runs | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
release-flag: | ||
if: contains(github.event.head_commit.message, '!!release') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
pypi-flag: | ||
if: contains(github.event.head_commit.message, '!!pypi') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
|
||
master-flag: | ||
if: contains(github.event.head_commit.message, '!!master') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
test: | ||
timeout-minutes: 15 | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest, windows-latest ] | ||
python-version: [ 3.7, '3.11.0-rc.2' ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade setuptools distlib | ||
pip install -e . | ||
pip install -r requirements.txt | ||
- name: Lint | ||
run: | | ||
python3 ./do.py lint | ||
- name: Run unit tests | ||
run: | | ||
python3 ./do.py test | ||
- name: Run pkg tests | ||
# важно, чтобы в случае Windows это был действительно python, а | ||
# не python3. Иначе вызовы самого-себя в качестве дочернего процесса | ||
# приведут к ошибкам с "ненайденными файлами". Ненайденный - вероятно | ||
# сам пайтоне внутри venv | ||
run: | | ||
python ./do.py test-pkg | ||
|
||
to-staging: | ||
needs: [test, build-exe] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Merge current -> staging | ||
uses: devmasx/[email protected] | ||
with: | ||
type: now | ||
target_branch: staging | ||
github_token: ${{ github.token }} | ||
|
||
build-exe: | ||
#needs: [ to-staging ] | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest, windows-latest ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8.10' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade setuptools distlib | ||
pip install -e . | ||
pip install -r requirements.txt | ||
- name: Build | ||
run: python ./do.py build | ||
- name: Run exe (test A) | ||
run: dist/img2texture --version | ||
- name: Run exe (test B) | ||
run: dist/img2texture docs/1_orion_src.jpg texture.tmp.jpg | ||
- name: Store Exe as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: binary_from_${{ matrix.os }} | ||
path: dist/* | ||
retention-days: 3 | ||
|
||
to-master: | ||
# if the commit message was "publish", copy the tested code | ||
# to "master" branch and create GitHub release | ||
|
||
needs: [ to-staging, master-flag ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# UPDATE MASTER BRANCH | ||
- name: Merge to master branch | ||
uses: devmasx/[email protected] | ||
with: | ||
type: now | ||
target_branch: master | ||
github_token: ${{ github.token }} | ||
|
||
to-pypi: | ||
needs: [ to-master, pypi-flag ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# ADD PYPI RELEASE | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USR }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PWD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
|
||
|
||
to-github-release: | ||
needs: [ build-exe, to-staging, release-flag ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get previously built artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: downloaded_artifacts | ||
|
||
- name: Create distributable archives | ||
run: | | ||
wget -c https://github.com/rtmigo/exe2dist/releases/latest/download/exe2dist_linux_amd64.tgz -O - | tar -xz | ||
./exe2dist img2texture 'downloaded_artifacts/*/*' dist | ||
|
||
- name: Get the project version | ||
run: | | ||
echo "::set-output name=VER::$(python setup.py --version)" | ||
id: version | ||
|
||
- name: Publish GitHub release | ||
id: publish_github_release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ steps.version.outputs.VER }} | ||
files: ./dist/* | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: build-dev | ||
|
||
on: | ||
push: | ||
branches: [ dev ] | ||
paths-ignore: | ||
- '**.md' | ||
- '**.txt' | ||
|
||
concurrency: | ||
# subsequently queued workflow run will interrupt previous runs | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
|
||
build-exe: | ||
#needs: [ to-staging ] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e . | ||
pip install -r requirements.txt | ||
- name: Pip list | ||
run: pip list | tail -n +3 | awk '{print $1}' | xargs pip show | grep -E 'Location:|Name:' | cut -d ' ' -f 2 | paste -d ' ' - - | awk '{print $2 "/" tolower($1)}' | xargs du -sh 2> /dev/null | sort -hr | ||
- name: Build | ||
run: python ./do.py build | ||
- name: Run exe (test A) | ||
run: dist/img2texture --version | ||
- name: Run exe (test B) | ||
run: dist/img2texture docs/1_orion_src.jpg texture.tmp.jpg |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# 1.1.2 :: 2023-10-06 | ||
|
||
- Pillow version requirement raised to version 10.0.1+ to fix recent [security vulnerabilities](https://snyk.io/blog/critical-webp-0-day-cve-2023-4863/) | ||
- Python version requirement raised to 3.8 (was 3.7) — as requred by Pillow 10 | ||
- Added CI tests for Python 3.12 | ||
- Executables are now built with Python 3.12 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# SPDX-FileCopyrightText: (c) 2021 Artёm iG <github.com/rtmigo> | ||
# SPDX-License-Identifier: MIT | ||
|
||
from ._texturizing import file_to_seamless, image_to_seamless, img2tex | ||
from ._cli import cli |
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
__version__ = "1.1.0" | ||
__version__ = "1.1.2" | ||
|
||
__copyright__ = "(c) Artem iG <[email protected]>" | ||
__copyright__ = "(c) Arte:m iG <[email protected]>" | ||
__license__ = "MIT" | ||
__build_timestamp__ = "2022-10-12 05:30:19" | ||
__build_timestamp__ = "2022-10-12 05:30:20" | ||
|
Oops, something went wrong.