-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (66 loc) · 1.86 KB
/
build-and-publish.yaml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build and publish to PyPI
on:
release:
types: [created]
workflow_dispatch:
jobs:
build:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
lfs: 'true'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build setuptools oldest-supported-numpy flake8
- name: Check for syntax errors
run: |
flake8 src/favapy --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Build sdist and wheels
run: python -m build
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist/*
build-streamlit-image:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- id: latest_release
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: mikelkou
repo: VAE_Functional_associations
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to ghcr.io
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/mikelkou/favapy:${{ steps.latest_release.outputs.release }}
ghcr.io/mikelkou/favapy:latest
publish-to-pypi:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}