-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added github action config file.
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 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,48 @@ | ||
# This code was auto generated by AfterShip SDK Generator. | ||
# Do not edit the class manually. | ||
|
||
name: Release to PyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Python # Set Python version | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip poetry | ||
poetry config virtualenvs.in-project --unset | ||
make install | ||
- name: Build | ||
run: | | ||
make build | ||
- name: Format | ||
run: | | ||
make format | ||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.get_version.outputs.VERSION }} | ||
path: dist | ||
|
||
- name: Release to PyPI | ||
run: | | ||
pip install twine | ||
twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --verbose dist/* |