-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a CD job running on tag in charge of building the Python package and pushing it to PyPI aswell as creating a GH release.
- Loading branch information
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
architecture: 'x64' | ||
|
||
- name: setup build env | ||
run: | | ||
python3 -m pip install --upgrade pip build twine | ||
# - name: build & push | ||
# env: | ||
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
# run: | | ||
# python3 -m build | ||
# python3 -m twine upload --user "__token__" \ | ||
# --password "$PYPI_TOKEN" \ | ||
# --non-interactive \ | ||
# dist/* | ||
|
||
- name: craft changelog | ||
id: craft-changelog | ||
run: | | ||
echo "CHANGELOG<<MDR" >> $GITHUB_ENV | ||
echo "## changelog" >> $GITHUB_ENV | ||
if [[ $(git tag | wc -l) -ge 2 ]]; then | ||
git_changelog_range="$(git describe --abbrev=0 ${GITHUB_REF}^)..$GITHUB_REF)" | ||
fi | ||
git log --pretty='%s ' ${git_changelog_range} >> $GITHUB_ENV | ||
echo "MDR" >> $GITHUB_ENV | ||
- name: gh-release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body: ${{ env.CHANGELOG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters