Skip to content

Commit

Permalink
👷 Fix GHA release workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalkrupinski committed Oct 27, 2024
1 parent e8a186f commit 304d7e7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 41 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/draft-release.yaml

This file was deleted.

36 changes: 34 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ jobs:
shell: bash
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -61,3 +60,36 @@ jobs:

- name: Run pytest
run: uv run pytest

release-draft:
name: Draft Release
needs: tests
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')

permissions:
contents: write

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- name: Build Project
run: uv build

- name: Create Draft Release
env:
TAG_NAME: ${{ github.ref_name }}
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$TAG_NAME" \
--repo "$GITHUB_REPOSITORY" \
--title "${GITHUB_REPOSITORY#*/} ${TAG_NAME#v}" \
--generate-notes \
--draft \
dist/*.tar.gz dist/*.whl

0 comments on commit 304d7e7

Please sign in to comment.