Fix Conda package deployment (take 3) #61
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
name: Deploy Conda and PyPI packages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ${{ matrix.os }} | |
environment: deployment | |
strategy: | |
matrix: | |
architecture: | |
- x64 | |
os: | |
- macos-latest-large | |
- ubuntu-latest | |
- windows-latest | |
include: | |
- architecture: arm64 | |
os: macos-latest-xlarge | |
name: Deploy on ${{ matrix.os }}-${{ matrix.architecture }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/build-jdk | |
with: | |
os: ${{ matrix.os }} | |
python-version: "3.12" | |
- uses: ./.github/actions/create-python-wheel | |
with: | |
build-number: ${{ env.JDK4PY_BUILD_NUMBER }} | |
- uses: ./.github/actions/create-conda-package | |
with: | |
architecture: ${{ matrix.architecture }} | |
- name: Upload Conda package | |
env: | |
JDK4PY_CONDA_CHANNEL_TOKEN: ${{ secrets.CONDA_CHANNEL_TOKEN }} | |
JDK4PY_CONDA_CHANNEL_URL: ${{ vars.CONDA_CHANNEL_URL }} | |
JDK4PY_CONDA_CHANNEL_USERNAME: ${{ vars.CONDA_CHANNEL_USERNAME }} | |
run: | | |
ls dist/$JDK4PY_CONDA_PLATFORM/jdk4py-*.tar.bz2 | \ | |
while read filepath; do | |
echo Uploading ${filepath} | |
curl --fail --user "$JDK4PY_CONDA_CHANNEL_USERNAME":"$JDK4PY_CONDA_CHANNEL_TOKEN" --upload-file ${filepath} "$JDK4PY_CONDA_CHANNEL_URL/$JDK4PY_CONDA_PLATFORM/" | |
done | |
shell: bash | |
- name: Upload Python wheel | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
run: poetry run twine upload dist/jdk4py-*.whl --username __token__ --password "$PYPI_TOKEN" | |
shell: bash |