bump: version 0.115.1 → 0.116.0 #435
Workflow file for this run
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: Upload Python Package | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
name: "Deploy version on Pypip and Dockerhub" | |
steps: | |
- name: Check out | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
token: '${{ secrets.GITHUB_TOKEN }}' | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.8' | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -e '.[dev]' | |
- name: Run tests and linters | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
python3 -m black naas_drivers | |
python3 -m flake8 naas_drivers | |
pytest --cov=./naas_drivers --cov-report=xml | |
# - name: Upload coverage to Codecov | |
# if: runner.os == 'Linux' | |
# uses: codecov/[email protected] | |
# with: | |
# token: ${{secrets.CODECOV_TOKEN}} | |
# file: ./coverage.xml | |
# flags: unittests | |
# name: codecov-umbrella | |
- name: Build package | |
run: python3 setup.py sdist | |
- name: Deploy Pypi | |
uses: remorses/pypi@v3 | |
with: | |
username: ${{ secrets.PYPIP_USERNAME }} | |
password: ${{ secrets.PYPIP_PASSWORD }} | |
- uses: actions-ecosystem/action-get-latest-tag@v1 | |
id: get-latest-tag | |
- uses: actions-ecosystem/action-regex-match@v2 | |
id: regex-match | |
with: | |
text: ${{ steps.get-latest-tag.outputs.tag }} | |
regex: '^\d*\.\d*\.\d*$' | |
- name: Checkout Target Repository | |
if: ${{ steps.regex-match.outputs.match != '' }} | |
uses: actions/checkout@v2 | |
with: | |
repository: jupyter-naas/naas | |
path: naas_repo | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- run: echo ${{ steps.get-latest-tag.outputs.tag }} | |
- name: Update naas file | |
if: ${{ steps.regex-match.outputs.match != '' }} | |
run: sed -i 's/NDV = ".*"/NDV = "${{ steps.get-latest-tag.outputs.tag }}"/' naas_repo/setup.py | |
- name: Setup github user | |
if: ${{ steps.regex-match.outputs.match != '' }} | |
run: git config --global user.name "actions-user" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Push naas file | |
if: ${{ steps.regex-match.outputs.match != '' }} | |
run: 'cd naas_repo && git add setup.py && git commit -m "fix(dependency): update naas_drivers ${{ steps.get-latest-tag.outputs.tag }}" && git push' | |
- name: Get the last version change | |
id: lastchanges | |
uses: jupyter-naas/[email protected] | |
- name: Slack notification | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_USERNAME: Naas_drivers # Optional. (defaults to webhook app) | |
SLACK_CHANNEL: naas-ci # Optional. (defaults to webhook) | |
SLACK_AVATAR: repository | |
SLACK_CUSTOM_PAYLOAD: '{"attachments":[{"color":"#47dd82","blocks":[{"type":"section","block_id":"section567","text":{"type":"mrkdwn","text":"<https://github.com/{{ GITHUB_REPOSITORY }}|{{ GITHUB_REPOSITORY }}>\nAvailable to pip.\n*Version*\n${{ steps.get-latest-tag.outputs.tag }}\n ${{ steps.lastchanges.outputs.lastChanges }}"},"accessory":{"type":"image","image_url":"https://github.com/jupyter-naas/naas/raw/main/custom/naas-fav.png","alt_text":"Naas logo"}}]}]}' | |
uses: Ilshidur/[email protected] |