wip: testing the publish action #1
This file contains hidden or 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: Publish Casp CLI to PyPI | |
| # on: | |
| # release: | |
| # types: [published] | |
| # jobs: | |
| # publish-pypi: | |
| # name: Build and Publish CLI | |
| # runs-on: ubuntu-latest | |
| # permissions: | |
| # contents: read | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # fetch-depth: 0 | |
| # - name: Check for changes in cli/casp | |
| # id: check_changes | |
| # run: | | |
| # PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || true) | |
| # if [ -z "$PREV_TAG" ]; then | |
| # echo "No previous tag found (likely first release). Publishing..." | |
| # echo "changed=true" >> "$GITHUB_OUTPUT" | |
| # else | |
| # echo "Previous release tag found: $PREV_TAG" | |
| # if git diff --quiet "$PREV_TAG" HEAD -- cli/casp; then | |
| # echo "No changes detected in cli/casp." | |
| # echo "changed=false" >> "$GITHUB_OUTPUT" | |
| # else | |
| # echo "Changes detected in cli/casp." | |
| # echo "changed=true" >> "$GITHUB_OUTPUT" | |
| # fi | |
| # fi | |
| # - name: Set up Python | |
| # if: steps.check_changes.outputs.changed == 'true' | |
| # uses: actions/setup-python@v4 | |
| # with: | |
| # python-version: '3.11' | |
| # - name: Install build dependencies | |
| # if: steps.check_changes.outputs.changed == 'true' | |
| # run: python -m pip install build --user | |
| # - name: Build package | |
| # if: steps.check_changes.outputs.changed == 'true' | |
| # working-directory: cli/casp | |
| # run: python -m build | |
| # - name: Publish to PyPI | |
| # if: steps.check_changes.outputs.changed == 'true' | |
| # uses: pypa/gh-action-pypi-publish@release/v1 | |
| # with: | |
| # password: ${{ secrets.PYPI_API_TOKEN }} | |
| # packages_dir: cli/casp/dist/ | |
| # skip_existing: true |