-
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.
add github workflow to build and publish
- Loading branch information
Showing
3 changed files
with
50 additions
and
2 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,45 @@ | ||
name: "Build and Publish" | ||
run-name: "Build ${{ github.ref_name }} by @${{ github.actor }}" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
type: string | ||
required: true | ||
description: Version | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
submodules: true | ||
fetch-tags: true | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Build pip package | ||
run: | | ||
pip3 install -U pip build | ||
export VERSION="${{inputs.version}}" | ||
python3 -m build --sdist --wheel --outdir dist/ . | ||
- name: Create git tag | ||
run: | | ||
set -x | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "github-actions" | ||
git tag ${{inputs.version}} | ||
git push --no-verify origin ${{inputs.version}} | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages-dir: dist |
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
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