Skip to content

Commit

Permalink
Fixing outdated release workflow (#227)
Browse files Browse the repository at this point in the history
* updating release workflow

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
dfm and pre-commit-ci[bot] committed Apr 7, 2023
1 parent 9630718 commit 34847fc
Showing 1 changed file with 33 additions and 16 deletions.
49 changes: 33 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ on:
tags:
- "*"
pull_request:
workflow_dispatch:
inputs:
prerelease:
description: 'Run a pre-release, testing the build'
required: false
type: boolean
default: false

jobs:
tests:
Expand Down Expand Up @@ -63,12 +56,36 @@ jobs:
name: images-${{ matrix.os }}-${{ matrix.python-version }}
path: ./result_images

release:
if: ${{ inputs.prerelease || startsWith(github.ref, 'refs/tags/') }}
needs: tests
uses: dfm/workflows/.github/workflows/python-release.yml@v0.1.0
with:
wheels: false
enable-windows: false
secrets:
pypi-token: ${{ secrets.pypi_password }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.10"
- name: Build sdist and wheel
run: |
python -m pip install -U pip
python -m pip install -U build
python -m build .
- uses: actions/upload-artifact@v3
with:
path: dist/*

upload_pypi:
needs: [tests, build]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.8.4
with:
user: __token__
password: ${{ secrets.pypi_password }}

0 comments on commit 34847fc

Please sign in to comment.