Skip to content

Commit

Permalink
Merge pull request #11 from brunorosilva/feature/enable-pypi-deploy
Browse files Browse the repository at this point in the history
Feature/enable pypi deploy
  • Loading branch information
brunorosilva authored Aug 2, 2022
2 parents 7f722e8 + 98e2513 commit b8057fa
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/plotly_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: [ main ]

jobs:
build:
checks:

runs-on: ubuntu-latest

Expand Down Expand Up @@ -41,5 +41,4 @@ jobs:
run: make lint

- name: Run checks
run: make checks

run: make checks
47 changes: 47 additions & 0 deletions .github/workflows/release_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Upload Calplot to Pypi
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
on:
release:
types: [ created ]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install Poetry
uses: dschep/[email protected]

- name: Cache Poetry virtualenv
uses: actions/cache@v1
id: cache
with:
path: ~/.virtualenvs
key: poetry-$
restore-keys: |
poetry-$
- name: Create dists
run: poetry build

- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PLOTLY_DEV_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PLOTLY_PRD_TOKEN }}
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,12 @@ checks:
@poetry run poetry check

pypi_deploy:
@poetry config pypi-token.pypi $(PLOTLY_PRD_TOKEN)
@poetry build
@poetry publish
@poetry publish

testpypi_deploy:
@poetry config repositories.test-pypi https://test.pypi.org/legacy/
@poetry config pypi-token.test-pypi $(PLOTLY_DEV_TOKEN)
@poetry build
@poetry publish -r test-pypi

0 comments on commit b8057fa

Please sign in to comment.