diff --git a/.github/workflows/createNewRelease.yaml b/.github/workflows/createNewRelease.yaml index 029da25b40..1df9f81b85 100644 --- a/.github/workflows/createNewRelease.yaml +++ b/.github/workflows/createNewRelease.yaml @@ -63,46 +63,12 @@ jobs: run: | VERSION_WITH_PHDI=$(poetry version) echo "version=${VERSION_WITH_PHDI:5}" >> $GITHUB_OUTPUT - # Create new release tag - - name: Set up Git user - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - - name: Tag Release - uses: EndBug/latest-tag@latest - with: - ref: ${{ steps.get_version.outputs.version }} - # Generate release notes - - name: Generate release notes - id: release_notes + - name: Create release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ steps.get_version.outputs.version }} run: | - latest_release_date=$(gh api "/repos/$GITHUB_REPOSITORY/releases?per_page=1" | jq ".[0].created_at") - prs=$(gh pr list --base main --state closed --json title,number,url,closedAt -q ".[] | select(.closedAt > $latest_release_date) | select(.title | contains(\"RELEASE\") | not)") - - echo "# Release Notes" > release-notes.md - echo "" >> release-notes.md - echo "" >> release-notes.md - - while IFS= read -r pr; do - pr_title=$(echo "$pr" | jq -r ".title") - pr_number=$(echo "$pr" | jq -r ".number") - pr_url=$(echo "$pr" | jq -r ".url") - line_text="- $pr_title ([#$pr_number]($pr_url))" - echo $line_text >> release-notes.md - done < <(printf '%s' "$prs") - - # Create new release based upon the latest created tag - - name: Create Release - id: create_release - uses: actions/create-release@v1.1.4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.get_version.outputs.version }} - release_name: ${{ steps.get_version.outputs.version }} - body_path: release-notes.md + gh release create "$tag" --generate-notes release-to-pypi: name: Build and publish PHDI to PyPI