Merge pull request #535 from evandroforks/upload_wheels_to_pypi
Created the GitHub Actions step Upload to PyPi
This commit is contained in:
commit
342bb64092
76
.github/workflows/checks.yml
vendored
76
.github/workflows/checks.yml
vendored
@ -97,45 +97,81 @@ jobs:
|
|||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}${{ matrix.SEP }}pyenv
|
path: ${{ github.workspace }}${{ matrix.SEP }}pyenv
|
||||||
key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-14-
|
key: |
|
||||||
|
${{ runner.os }}-pyenv-
|
||||||
|
${{ hashFiles('**/requirements.*') }}-
|
||||||
|
${{ hashFiles('**/setup.py') }}-
|
||||||
|
${{ hashFiles('**/Makefile') }}-14-
|
||||||
|
|
||||||
# Disabling these caches for now because they do not seem to be used/help
|
# Disabling these caches for now because they do not seem to be used/help
|
||||||
# https://github.com/ankitects/anki/pull/528
|
# https://github.com/ankitects/anki/pull/528
|
||||||
# - name: Cache pip wheels
|
# - name: Cache pip wheels
|
||||||
|
# if: matrix.BUILD_TYPE == 'build'
|
||||||
# uses: actions/cache@v1
|
# uses: actions/cache@v1
|
||||||
# with:
|
# with:
|
||||||
# path: ${{ matrix.PIP_WHEELS_DIR }}
|
# path: ${{ matrix.PIP_WHEELS_DIR }}
|
||||||
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-14-
|
# key: |
|
||||||
|
# ${{ runner.os }}-pip-wheels-
|
||||||
|
# ${{ hashFiles('**/requirements.txt') }}-
|
||||||
|
# ${{ hashFiles('**/setup.py') }}-14-
|
||||||
|
|
||||||
- name: Cache cargo index
|
- name: Cache cargo index
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ${{ matrix.CARGO_INDEX_DIR }}
|
path: ${{ matrix.CARGO_INDEX_DIR }}
|
||||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-14-
|
key: |
|
||||||
|
${{ runner.os }}-cargo-index-
|
||||||
|
${{ hashFiles('**/requirements.*') }}-
|
||||||
|
${{ hashFiles('**/setup.py') }}-
|
||||||
|
${{ hashFiles('**/Makefile') }}-
|
||||||
|
${{ hashFiles('**/Cargo.toml') }}-14-
|
||||||
|
|
||||||
- name: Cache cargo registry
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ${{ matrix.CARGO_REGISTRY_DIR }}
|
path: ${{ matrix.CARGO_REGISTRY_DIR }}
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-14-
|
key: |
|
||||||
|
${{ runner.os }}-cargo-registry-
|
||||||
|
${{ hashFiles('**/requirements.*') }}-
|
||||||
|
${{ hashFiles('**/setup.py') }}-
|
||||||
|
${{ hashFiles('**/Makefile') }}-
|
||||||
|
${{ hashFiles('**/Cargo.toml') }}-14-
|
||||||
|
|
||||||
- name: Cache cargo target
|
- name: Cache cargo target
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}${{ matrix.SEP }}target
|
path: ${{ github.workspace }}${{ matrix.SEP }}target
|
||||||
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-${{ matrix.BUILD_TYPE }}-14-
|
key: |
|
||||||
|
${{ runner.os }}-cargo-target-
|
||||||
|
${{ hashFiles('**/requirements.*') }}-
|
||||||
|
${{ hashFiles('**/setup.py') }}-
|
||||||
|
${{ hashFiles('**/Makefile') }}-
|
||||||
|
${{ hashFiles('**/Cargo.toml') }}-
|
||||||
|
${{ matrix.BUILD_TYPE }}-14-
|
||||||
|
|
||||||
- name: Cache cargo rslib
|
- name: Cache cargo rslib
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}${{ matrix.SEP }}rslib${{ matrix.SEP }}target
|
path: ${{ github.workspace }}${{ matrix.SEP }}rslib${{ matrix.SEP }}target
|
||||||
key: ${{ runner.os }}-cargo-rslib-${{ hashFiles('**/Cargo.toml') }}-${{ matrix.BUILD_TYPE }}-14-
|
key: |
|
||||||
|
${{ runner.os }}-cargo-rslib-
|
||||||
|
${{ hashFiles('**/requirements.*') }}-
|
||||||
|
${{ hashFiles('**/setup.py') }}-
|
||||||
|
${{ hashFiles('**/Makefile') }}-
|
||||||
|
${{ hashFiles('**/Cargo.toml') }}-
|
||||||
|
${{ matrix.BUILD_TYPE }}-14-
|
||||||
|
|
||||||
- name: Cache cargo rspy
|
- name: Cache cargo rspy
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}${{ matrix.SEP }}rspy${{ matrix.SEP }}target
|
path: ${{ github.workspace }}${{ matrix.SEP }}rspy${{ matrix.SEP }}target
|
||||||
key: ${{ runner.os }}-cargo-rspy-${{ hashFiles('**/Cargo.toml') }}-${{ matrix.BUILD_TYPE }}-14-
|
key: |
|
||||||
|
${{ runner.os }}-cargo-rspy-
|
||||||
|
${{ hashFiles('**/requirements.*') }}-
|
||||||
|
${{ hashFiles('**/setup.py') }}-
|
||||||
|
${{ hashFiles('**/Makefile') }}-
|
||||||
|
${{ hashFiles('**/Cargo.toml') }}-
|
||||||
|
${{ matrix.BUILD_TYPE }}-14-
|
||||||
|
|
||||||
- name: Cache pacman
|
- name: Cache pacman
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
@ -143,7 +179,9 @@ jobs:
|
|||||||
id: cache-pacman
|
id: cache-pacman
|
||||||
with:
|
with:
|
||||||
path: C:\Program Files\Git
|
path: C:\Program Files\Git
|
||||||
key: ${{ runner.os }}-pacman-${{ hashFiles('**/checks.yml') }}-14-
|
key: |
|
||||||
|
${{ runner.os }}-pacman-
|
||||||
|
${{ hashFiles('**/checks.yml') }}-14-
|
||||||
|
|
||||||
- name: Set up pacman, rsync
|
- name: Set up pacman, rsync
|
||||||
if: matrix.os == 'windows-latest' && steps.cache-pacman.outputs.cache-hit != 'true'
|
if: matrix.os == 'windows-latest' && steps.cache-pacman.outputs.cache-hit != 'true'
|
||||||
@ -239,3 +277,25 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: ${{ matrix.ANKI_PYTHON_WHEELS }}
|
name: ${{ matrix.ANKI_PYTHON_WHEELS }}
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
|
- name: Upload to PyPi Windows
|
||||||
|
if: matrix.BUILD_TYPE == 'build' && startsWith(github.ref, 'refs/tags/') && matrix.os == 'windows-latest'
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
|
||||||
|
TWINE_USERNAME: __token__
|
||||||
|
run: |
|
||||||
|
echo on
|
||||||
|
rm -f "dist/%pyaudio%"
|
||||||
|
python -m pip install twine
|
||||||
|
twine upload --non-interactive --skip-existing --verbose dist/*
|
||||||
|
|
||||||
|
- name: Upload to PyPi Linux/Mac OS
|
||||||
|
if: matrix.BUILD_TYPE == 'build' && startsWith(github.ref, 'refs/tags/') && ( matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' )
|
||||||
|
env:
|
||||||
|
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
|
||||||
|
TWINE_USERNAME: __token__
|
||||||
|
run: |
|
||||||
|
set -x
|
||||||
|
python -m pip install twine
|
||||||
|
twine upload --non-interactive --skip-existing --verbose dist/*
|
||||||
|
@ -52,7 +52,7 @@ PROTODEPS := $(wildcard ../proto/*.proto)
|
|||||||
python -m black anki/hooks.py
|
python -m black anki/hooks.py
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
BUILD_STEPS := .build/run-deps .build/dev-deps .build/py-proto anki/buildinfo.py .build/hooks
|
BUILD_STEPS := .build/vernum .build/run-deps .build/dev-deps .build/py-proto anki/buildinfo.py .build/hooks
|
||||||
|
|
||||||
# Checking
|
# Checking
|
||||||
######################
|
######################
|
||||||
@ -111,3 +111,9 @@ develop: $(BUILD_STEPS)
|
|||||||
anki/buildinfo.py: ../meta/version ../meta/buildhash
|
anki/buildinfo.py: ../meta/version ../meta/buildhash
|
||||||
echo "buildhash='$$(cat ../meta/buildhash)'" > $@
|
echo "buildhash='$$(cat ../meta/buildhash)'" > $@
|
||||||
echo "version='$$(cat ../meta/version)'" >> $@
|
echo "version='$$(cat ../meta/version)'" >> $@
|
||||||
|
|
||||||
|
VER := $(shell cat ../meta/version)
|
||||||
|
.build/vernum: ../meta/version
|
||||||
|
sed -i.bak 's/.*automatically updated.*/ version="$(VER)", # automatically updated/' setup.py
|
||||||
|
rm setup.py.bak
|
||||||
|
@touch $@
|
||||||
|
4
pylib/pyproject.toml
Normal file
4
pylib/pyproject.toml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[build-system]
|
||||||
|
# Minimum requirements for the build system to execute.
|
||||||
|
# https://stackoverflow.com/questions/48048745/setup-py-require-a-recent-version-of-setuptools-before-trying-to-install
|
||||||
|
requires = ["setuptools", "wheel"]
|
@ -1,11 +1,21 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
with open("../meta/version") as fh:
|
install_requires = [
|
||||||
version = fh.read().strip()
|
"beautifulsoup4",
|
||||||
|
"requests",
|
||||||
|
"decorator",
|
||||||
|
"protobuf",
|
||||||
|
'orjson; platform_machine == "x86_64"',
|
||||||
|
'psutil; sys_platform == "win32"',
|
||||||
|
'distro; sys_platform != "darwin" and sys_platform != "win32"',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="anki",
|
name="anki",
|
||||||
version=version,
|
version="2.1.24", # automatically updated
|
||||||
author="Ankitects Pty Ltd",
|
author="Ankitects Pty Ltd",
|
||||||
description="Anki's library code",
|
description="Anki's library code",
|
||||||
long_description="Anki's library code",
|
long_description="Anki's library code",
|
||||||
@ -16,13 +26,5 @@ setuptools.setup(
|
|||||||
package_data={"anki": ["py.typed"]},
|
package_data={"anki": ["py.typed"]},
|
||||||
classifiers=[],
|
classifiers=[],
|
||||||
python_requires=">=3.7",
|
python_requires=">=3.7",
|
||||||
install_requires=[
|
install_requires=install_requires,
|
||||||
"beautifulsoup4",
|
|
||||||
"requests",
|
|
||||||
"decorator",
|
|
||||||
"protobuf",
|
|
||||||
'orjson; platform_machine == "x86_64"',
|
|
||||||
'psutil; sys_platform == "win32"',
|
|
||||||
'distro; sys_platform != "darwin" and sys_platform != "win32"',
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import setuptools
|
import setuptools
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "anki"
|
name = "anki"
|
||||||
version = "2.1.24" # automatically updated
|
version = "2.1.24" # automatically updated
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
authors = ["Ankitects Pty Ltd and contributors"]
|
authors = ["Ankitects Pty Ltd and contributors <pypi@cargo.bug>"]
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
|
description = "Anki's Rust library code"
|
||||||
|
readme = "README.md"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nom = "5.0.1"
|
nom = "5.0.1"
|
||||||
|
@ -49,6 +49,6 @@ RUST_TOOLCHAIN := $(shell cat rust-toolchain)
|
|||||||
|
|
||||||
VER := $(shell cat ../meta/version)
|
VER := $(shell cat ../meta/version)
|
||||||
.build/vernum: ../meta/version
|
.build/vernum: ../meta/version
|
||||||
sed -i.bak 's/.*automatically updated.*/version = "$(VER)" # automatically updated/' Cargo.toml
|
sed -i.bak 's/.*automatically updated.*/version = "$(VER)" # automatically updated/' Cargo.toml
|
||||||
rm Cargo.toml.bak
|
rm Cargo.toml.bak
|
||||||
@touch $@
|
@touch $@
|
||||||
|
3
rslib/README.md
Normal file
3
rslib/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Anki's Rust library code
|
||||||
|
|
||||||
|
https://anki.tenderapp.com/discussions/ankidesktop/40025-anki-in-python-package-index
|
@ -1,8 +1,11 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ankirspy"
|
name = "ankirspy"
|
||||||
version = "2.1.24" # automatically updated
|
version = "2.1.24" # automatically updated
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
authors = ["Ankitects Pty Ltd and contributors"]
|
authors = ["Ankitects Pty Ltd and contributors <pypi@cargo.bug>"]
|
||||||
|
license = "AGPL-3.0-or-later"
|
||||||
|
description = "Anki's Rust library code Python bindings"
|
||||||
|
readme = "README.md"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anki = { path = "../rslib" }
|
anki = { path = "../rslib" }
|
||||||
|
@ -91,6 +91,6 @@ RUST_TOOLCHAIN := $(shell cat rust-toolchain)
|
|||||||
|
|
||||||
VER := $(shell cat ../meta/version)
|
VER := $(shell cat ../meta/version)
|
||||||
.build/vernum: ../meta/version
|
.build/vernum: ../meta/version
|
||||||
sed -i.bak 's/.*automatically updated.*/version = "$(VER)" # automatically updated/' Cargo.toml
|
sed -i.bak 's/.*automatically updated.*/version = "$(VER)" # automatically updated/' Cargo.toml
|
||||||
rm Cargo.toml.bak
|
rm Cargo.toml.bak
|
||||||
@touch $@
|
@touch $@
|
||||||
|
3
rspy/README.md
Normal file
3
rspy/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Anki's Rust library code Python bindings
|
||||||
|
|
||||||
|
https://anki.tenderapp.com/discussions/ankidesktop/40025-anki-in-python-package-index
|
Loading…
Reference in New Issue
Block a user