Skip to content

Commit

Permalink
ci: Add changelog to GH release (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
coletdjnz authored Sep 10, 2024
1 parent b78e08c commit f5af08c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
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

0 comments on commit f5af08c

Please sign in to comment.