Seet nullglob in deploy to avoid passing *.whl to deploy script. #2
Workflow file for this run
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
# Copyright 2023 Shukant Pal | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Publish to PyPI | |
on: | |
workflow_dispatch: | |
push: | |
# Trigger on push of release tags. There is no way to limit the trigger | |
# to a specific branch. A later build step checks for the main branch. | |
tags: | |
- 'v[0-9]+\.[0-9]+\.[0-9]+' | |
- 'v[0-9]+\.[0-9]+\.[0-9]+-*' | |
jobs: | |
pypi: | |
runs-on: ubuntu-latest | |
if: endsWith(github.event.base_ref, 'main') | |
steps: | |
- name: Download latest release metadata | |
run: | | |
curl \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-o latest.json \ | |
https://api.github.com/repos/KhronosGroup/KTX-Software/releases/latest | |
- name: Filter out pyktx- assets | |
run: | | |
jq '.assets | map(select(.name | startswith("pyktx-"))) | map(.browser_download_url)' < latest.json > pyktx.json | |
- name: Create dist directory | |
run: | | |
mkdir dist | |
- name: Download assets | |
run: | | |
cd dist; jq -c '.[]' ../pyktx.json | xargs -L 1 curl -O -J; cd.. | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |