-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.06 KB
/
Copy pathci-publish.yml
File metadata and controls
50 lines (40 loc) · 1.06 KB
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: CI + Publish to PyPI
on:
push:
tags:
- "v*"
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.10"
activate-environment: ci-env # (CORRIGIDO)
environment-file: environment.yml # cria automaticamente
use-mamba: true
auto-update-conda: true
- name: Verify environment
run: conda info && conda list
- name: Run tests
run: |
python -m pip install -e .
pytest
publish:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}