Merge pull request #261 from blockchyp/develop #80
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
name: blockchyp-python | |
on: | |
push: | |
branches: | |
- "develop" | |
- "master" | |
- "preview" | |
tags: | |
- "*" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
container: | |
image: python:3.7-buster | |
steps: | |
- uses: act10ns/slack@v1 | |
with: | |
status: starting | |
channel: '#gitactivity' | |
if: always() | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Requirements | |
run: pip install --user -r requirements-dev.txt | |
- name: Run Build | |
run: make build | |
- name: Run Tests | |
run: make test | |
- uses: act10ns/slack@v1 | |
with: | |
status: ${{ job.status }} | |
channel: '#gitactivity' | |
if: always() | |
publish: | |
runs-on: ubuntu-latest | |
container: | |
image: python:3.7-buster | |
if: ${{ always() && contains(join(needs.*.result, ','), 'success') && startsWith(github.ref_name, 'v') }} | |
needs: [ test ] | |
steps: | |
- uses: act10ns/slack@v1 | |
with: | |
status: starting | |
channel: '#gitactivity' | |
if: always() | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Granting private modules access | |
run: git config --global url."https://${{ secrets.SDK_GEN_REPO_TOKEN }}:x-oauth-basic@github.com/blockchyp".insteadOf "https://github.com/blockchyp" | |
- name: Temporary Git Workaround | |
run: git config --global --add safe.directory /__w/blockchyp-python/blockchyp-python | |
- name: Install Requirements | |
run: pip install --user -r requirements-dev.txt | |
- name: Run Build | |
run: make build | |
- name: Stage Credentials | |
run: | | |
echo "[pypi]" > ~/.pypirc | |
echo "username = $PYPI_USERNAME" >> ~/.pypirc | |
echo "password = $PYPI_PASSWORD" >> ~/.pypirc | |
- name: Publish to PyPi | |
run: make publish | |
- uses: act10ns/slack@v1 | |
with: | |
status: ${{ job.status }} | |
channel: '#gitactivity' | |
if: always() |