File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 2929 echo "Version in mysql-to-sqlite3/__version__.py ($VERSION) does not match tag ($TAG)"
3030 exit 1
3131 fi
32+ echo "VERSION=$VERSION" >> $GITHUB_ENV
3233 - name : Set up Python
3334 id : setup_python
3435 uses : actions/setup-python@v4
5455 id : publish
5556 if : startsWith(github.ref, 'refs/tags')
5657 uses : pypa/gh-action-pypi-publish@release/v1
58+ - name : Install pyproject-parser
59+ id : install_pyproject_parser
60+ run : |
61+ set -e
62+ pip install pyproject-parser[cli]
63+ - name : Read project name from pyproject.toml
64+ id : read_project_name
65+ run : |
66+ set -e
67+ NAME=$(pyproject-parser info project.name -r | tr -d '"')
68+ echo "NAME=$NAME" >> $GITHUB_ENV
69+ - name : Create tag-specific CHANGELOG
70+ id : create_changelog
71+ run : |
72+ set -e
73+ CHANGELOG_PATH=$RUNNER_TEMP/CHANGELOG.md
74+ awk '/^#[[:space:]].*/ { if (count == 1) exit; count++; print } count == 1 && !/^#[[:space:]].*/ { print }' CHANGELOG.md | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' > $CHANGELOG_PATH
75+ echo -en "\n[https://pypi.org/project/$NAME/$VERSION/](https://pypi.org/project/$NAME/$VERSION/)" >> $CHANGELOG_PATH
76+ echo "CHANGELOG_PATH=$CHANGELOG_PATH" >> $GITHUB_ENV
77+ - name : Github Release
78+ id : github_release
79+ uses : softprops/action-gh-release@v1
80+ with :
81+ name : ${{ env.VERSION }}
82+ tag_name : ${{ github.ref }}
83+ body : ${{ env.CHANGELOG_PATH }}
84+ files : |
85+ dist/*.whl
86+ dist/*.tar.gz
87+ - name : Cleanup
88+ if : ${{ always() }}
89+ run : |
90+ rm -rf dist
91+ rm -rf $CHANGELOG_PATH
You can’t perform that action at this time.
0 commit comments