Fix deploy by using local directory #10
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
name: Release | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | |
pull_request: | |
paths: | |
- .github/workflows/release.yml | |
jobs: | |
release: | |
# requires that you have put your twine API key in your | |
# github secrets (see readme for details) | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hynek/build-and-inspect-python-package@v2 | |
id: build_dist | |
- name: determine tag | |
run: echo "tag=${GITHUB_REF/refs\/tags\/v/}" >> "$GITHUB_ENV" | |
- name: debug dist | |
run: set -x | |
echo "dist=${{ steps.build_dist.outputs.dist }}" | |
ls -l ${{ steps.build_dist.outputs.dist }} | |
- name: Create Release | |
uses: "softprops/action-gh-release@v2" | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
with: | |
tag_name: ${{ github.ref }} | |
name: ${{ env.tag }} | |
draft: false | |
prerelease: ${{ contains(env.tag, 'rc') || contains(env.tag, 'a') || contains(env.tag, 'b') }} | |
target_commitish: ${{ github.sha }} | |
files: ${{ steps.build_dist.outputs.dist }} | |
- name: Publish PyPI Package | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TWINE_API_KEY }} | |
packages-dir: ${{ steps.build_dist.outputs.dist }} |