|
| 1 | +name: Publish/Release New Version |
| 2 | +on: |
| 3 | + push: |
| 4 | + # Sequence of patterns matched against refs/tags |
| 5 | + tags: |
| 6 | + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 7 | + |
| 8 | +jobs: |
| 9 | + publish: |
| 10 | + name: Publish the release to pypi |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: setup extensions |
| 14 | + uses: actions/checkout@v1 |
| 15 | + |
| 16 | + - name: install build module |
| 17 | + run: | |
| 18 | + python -m pip install --upgrade pip |
| 19 | + pip install build |
| 20 | + |
| 21 | + - name: build project |
| 22 | + run: python -m build |
| 23 | + |
| 24 | + - name: publish to pypi |
| 25 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 26 | + with: |
| 27 | + user: ${{ secrets.PYPI_USER }} |
| 28 | + password: ${{ secrets.PYPI_PASSWORD }} |
| 29 | + repository_url: https://upload.pypi.org/legacy/ |
| 30 | + |
| 31 | + documentation: |
| 32 | + runs-on: ubuntu-latest |
| 33 | + if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')" |
| 34 | + steps: |
| 35 | + - name: setup extensions |
| 36 | + uses: actions/checkout@v1 |
| 37 | + |
| 38 | + - name: install pdoc |
| 39 | + run: pip install pdoc |
| 40 | + |
| 41 | + - name: generate pydoc |
| 42 | + run: | |
| 43 | + pip install -e . |
| 44 | + pdoc ibm_scc -o html |
| 45 | + |
| 46 | + - name: deploy python to gh-pages |
| 47 | + run: | |
| 48 | + git config --global user.email "[email protected]" |
| 49 | + git config --global user.name "sccdeveloper" |
| 50 | + git config --global user.password "${{ secrets.ADMIN_TOKEN }}" |
| 51 | + cd v4/dist |
| 52 | + git init |
| 53 | + git add . |
| 54 | + git commit -m "Deploy to GitHub pages" |
| 55 | + git branch -m gh-pages |
| 56 | + git remote add origin https://github.com/IBM/scc-python-sdk |
| 57 | + git push -f origin gh-pages |
| 58 | + env: |
| 59 | + GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }} |
| 60 | + GIT_AUTHOR_NAME: sccdeveloper |
| 61 | + GIT_AUTHOR_EMAIL: [email protected] |
| 62 | + GIT_COMMITTER_NAME: sccdeveloper |
| 63 | + GIT_COMMITTER_EMAIL: [email protected] |
0 commit comments