-
Notifications
You must be signed in to change notification settings - Fork 6
41 lines (40 loc) · 1.28 KB
/
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
name: Release
on: push
jobs:
test:
name: Deploy release to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
- name: Get the version
id: get_version
run: |
export ref=${GITHUB_REF##*/}
echo 'GHA_TAG_VERSION='${ref} >> $GITHUB_ENV
- name: Get the SHA1 of the git commit
id: get_hash
run: echo 'GHA_GIT_COMMIT=${GITHUB_SHA}' >> $GITHUB_ENV
- name: Build package
run: |
python setup.py sdist
python setup.py bdist_wheel --universal
- name: Run tests
run: |
python -m pip install matplotlib
python -m pip install --no-index --find-links=dist monashspa
python -m monashspa.tests
- name: Publish package to main PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_MASTER }}