diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f6a586..f1c83aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,18 +25,25 @@ jobs: echo "::group::Variables" cat << EOF | tee -a "$GITHUB_OUTPUT" tag=${tag} - version=v$(hatch project metadata | jq -r .version) + version=$(hatch project metadata | jq -r .version) + project_name=$(hatch project metadata | jq -r .name) EOF echo "::endgroup::" - - name: Bundle and create release + - name: Get Changelog Entry + id: changelog_reader + uses: mindsers/changelog-reader-action@v2 + with: + validation_level: error + version: ${{ steps.set_variables.outputs.version }} + path: ./CHANGELOG.md + - name: Bundle release env: GH_TOKEN: ${{ github.token }} tag: ${{ steps.set_variables.outputs.tag }} - version: ${{ steps.set_variables.outputs.version }} + version: v${{ steps.set_variables.outputs.version }} if: | env.tag != env.version run: | - project_name="$(hatch project metadata | jq -r .name)" sources="$(\ hatch run default:pip list --verbose --format json \ | jq -r '.[] | select(.editable_project_location == null) | "\(.name);\(.location)"' \ @@ -54,10 +61,17 @@ jobs: done <<<"${sources}" cd bundle/ find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete - zip -9 --recurse-paths "${project_name}" * - gh release create "${version}" --latest \ - --title "${project_name} ${version}" \ - "${project_name}.zip" + zip -9 --recurse-paths "${{ steps.set_variables.outputs.project_name }}" * + + - name: Create release + uses: ncipollo/release-action@v1 + with: + tag: v${{ steps.set_variables.outputs.version }} + name: ${{ steps.set_variables.outputs.project_name }} v${{ steps.set_variables.outputs.version }} + body: ${{ steps.changelog_reader.outputs.changes }} + makeLatest: true + artifacts: bundle/${{ steps.set_variables.outputs.project_name }}.zip + release_pypi: runs-on: ubuntu-latest permissions: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9847a3f..e5ecf40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,4 +4,6 @@ ### Added -- `VERSION` attribute to GetPOTProvider. Shown in verbose output for debugging purposes. \ No newline at end of file +- New `VERSION` attribute to GetPOTProvider. Shown in verbose output for debugging purposes. + +[unreleased]: https://github.com/coletdjnz/yt-dlp-get-pot/compare/v0.0.3...HEAD \ No newline at end of file