diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62d24d0..02cb9e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,10 @@ name: Release package on: - release: + push: # On push to these prerelease branches + branches: + - v2 + release: # On create a GitHub Release types: - created workflow_dispatch: @@ -24,7 +27,16 @@ jobs: python -m pip install --upgrade pip python -m pip install hatch hatch env create + echo "ASDF_PYDANTIC_VERSION=$(hatch version)" >> $GITHUB_ENV - name: Build run: hatch build + - name: Create GitHub Release (prerelease only) + if: github.event.push + uses: softprops/action-gh-release@v1 + with: + prerelease: true + tag: ${{ env.ASDF_PYDANTIC_VERSION }} + files: dist/* + generate_release_notes: true - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1