Feat/image folder support #24
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 to PyPI | |
on: | |
pull_request: | |
types: [closed] | |
branches: [main] | |
workflow_dispatch: | |
inputs: | |
dry-run: | |
required: true | |
default: true | |
type: boolean | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | |
outputs: | |
version: ${{ steps.get_version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/[email protected] | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install flit | |
flit install --deps production | |
- name: Get release version | |
id: get_version | |
run: | | |
echo "version=$(cat pyproject.toml | grep version | awk '{print $3}' | tr -d \"\\\"\")" >> $GITHUB_OUTPUT | |
- name: Build | |
run: | | |
flit build | |
flit publish | |
env: | |
FLIT_USERNAME: __token__ | |
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }} | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_VERSION: ${{ needs.build.outputs.version }} | |
run: | | |
gh release create "$RELEASE_VERSION" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${GITHUB_REPOSITORY#*/} ${RELEASE_VERSION}" \ | |
--generate-notes |