Skip to content

Commit

Permalink
Modify deploy job
Browse files Browse the repository at this point in the history
  • Loading branch information
paveldat committed Sep 12, 2023
1 parent 7c27f22 commit 37d41f0
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/deploy-job.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build, Test, Deploy

on: [push]
on:
push:
branches:
- main

jobs:
info:
Expand Down Expand Up @@ -54,22 +57,31 @@ jobs:
python3 -m pytest -sr tests/test_c*.py
deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: test
steps:
- uses: actions/checkout@v3
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v16
id: verify-changed-files
with:
files: |
src/**/*.py
setup.cfg
- name: Download artifacts
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: actions/download-artifact@v3
with:
name: built-artifacts
path: dist
- name: Publish package to Test PyPI
if: github.ref == 'refs/heads/main'
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish package to PyPI
if: github.ref == 'refs/heads/main'
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 37d41f0

Please sign in to comment.