-
Notifications
You must be signed in to change notification settings - Fork 960
50 lines (50 loc) · 1.72 KB
/
deploy_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Publish Release to PyPi
on:
release:
types: [published]
jobs:
gather-info:
runs-on: ubuntu-latest
steps:
- name: Get module for release
id: module_folder
run: echo "::set-output name=module_folder::$(awk '{print $1}' <<< "${{ github.event.release.name }}")"
outputs:
module_folder: ${{ steps.module_folder.outputs.module_folder }}
push-to-pypi:
runs-on: ubuntu-latest
needs: gather-info
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Add wheel dependency
run: pip install wheel
- name: Generate dist
run: python setup.py sdist bdist_wheel
working-directory: ${{ needs.gather-info.outputs.module_folder }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
packages_dir: ${{ needs.gather-info.outputs.module_folder }}/dist
build-and-publish-docker-image:
name: Build and publish docker image
needs: gather-info
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Login with docker
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Publish to Registry for latest
if: success()
run: make build-push-image-latest
working-directory: ${{ needs.gather-info.outputs.module_folder }}
- name: Publish to Registry for version
run: make build-push-image-version
working-directory: ${{ needs.gather-info.outputs.module_folder }}