-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from db0/release
release: pypi
- Loading branch information
Showing
2 changed files
with
64 additions
and
7 deletions.
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,63 @@ | ||
name: Pythörhead build and publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Pythörhead build and publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "✔️ Checkout" | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: "📣 Release on push" | ||
id: release | ||
uses: rymndhng/release-on-push-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
bump_version_scheme: norelease | ||
use_github_release_notes: true | ||
- name: "✏️ Generate release changelog" | ||
if: ${{ steps.release.outputs.version != '' }} | ||
uses: heinrichreimer/github-changelog-generator-action@v2.3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: "💾 Commit new version" | ||
if: ${{ steps.release.outputs.version != '' }} | ||
run: | | ||
sed -i 's/^version = ".*"/version = "${{ steps.release.outputs.version }}"/g' ./pyproject.toml | ||
git config user.email github-actions@github.com | ||
git config user.name github-actions | ||
git commit -am 'version incremented' | ||
git push | ||
- name: "🐍 Set up Python 3.10" | ||
if: ${{ steps.release.outputs.version != '' }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
- name: "🛠 Install pypa/build" | ||
if: ${{ steps.release.outputs.version != '' }} | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: "🔧 Build a binary wheel and a source tarball" | ||
if: ${{ steps.release.outputs.version != '' }} | ||
run: >- | ||
python -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
. | ||
- name: "📦 Publish distribution to PyPI" | ||
if: ${{ steps.release.outputs.version != '' }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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