diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a07c470 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +name: Classifier Release +run-name: Build classifier +on: [push] +jobs: + pypi-release: + name: Build and Release to PYPI 📦 + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/project/python-cptv/ + + if: startsWith(github.ref, 'refs/tags/v') + defaults: + run: + working-directory: ./python-bindings + + permissions: + id-token: write + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + architecture: 'x64' + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.77.1 + override: true + + - name: Display Rust and Cargo version + run: | + rustc --version + cargo --version + + - name: Build release + run: | + cargo build --release + + - name: Install pypa/build + run: >- + python3 -m + pip install + build maturin + --user + - name: Build a binary wheel and a source tarball + run: maturin publish diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e36ebd7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -dist: focal -arch: - - amd64 - - arm64 -language: python -services: - - docker -python: -- '3.10' -- '3.11' - -install: -- python -m pip install --upgrade pip -- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile=minimal -y -- export PATH=${TRAVIS_HOME}/.cargo/bin:$PATH -- rustup update -- python -m pip install --upgrade pip -- cd python-bindings -- pip install -r requirements.txt -script: -- ./build.sh -before_deploy: -- python3 -m pip install --upgrade build -- pip install maturin -- echo $'[pypi]\nusername = __token__\npassword = '$PYPI_TOKEN > ~/.pypirc -deploy: - - provider: script - script: maturin publish - on: - repo: TheCacophonyProject/cptv-tools - tags: true - skip_cleanup: 'true'