-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload package to PyPI and Dockerhub
- Loading branch information
Showing
5 changed files
with
115 additions
and
6 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 |
---|---|---|
@@ -1 +1,6 @@ | ||
**/* | ||
|
||
!src | ||
!**/*.py | ||
!pyproject.toml | ||
!poetry.lock |
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,73 @@ | ||
name: Publish Python Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- '[0-2].[0-9]+.[0-9]+*' | ||
|
||
jobs: | ||
|
||
pypi: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Extract tag name | ||
id: tag_name | ||
run: | | ||
echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//} | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Publish Package to PyPI | ||
env: | ||
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
poetry build | ||
poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD | ||
- name: Wait for PyPI to update indexes | ||
env: | ||
TAG: ${{ steps.tag_name.outputs.TAG }} | ||
run: | | ||
while [[ -z "$(grep ${TAG} <<< $(pip search audiomatch))" ]]; do | ||
echo "Not there yet..."; | ||
sleep 2s | ||
done; | ||
dockerhub: | ||
needs: pypi | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Extract tag name | ||
id: tag_name | ||
run: | | ||
echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//} | ||
- name: Build Docker image | ||
env: | ||
TAG: ${{ steps.tag_name.outputs.TAG }} | ||
run: | | ||
docker build . -t fdooch/audiomatch:"${TAG}" --build-arg package_version="${TAG}" | ||
- name: Log in to the Dockerhub registry | ||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
run: | | ||
echo "${DOCKERHUB_TOKEN}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin | ||
- name: Push to Dockerhub | ||
run: | | ||
docker push fdooch/audiomatch:"${TAG}" |
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
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