-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated requirements to fix libwebp security vulnerability
- Loading branch information
Showing
3 changed files
with
226 additions
and
1 deletion.
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
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