Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add changelog to release #6

Merged
merged 21 commits into from
Sep 10, 2024
30 changes: 22 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"' \
Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

### Added

- `VERSION` attribute to GetPOTProvider. Shown in verbose output for debugging purposes.
- 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
Loading