-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (74 loc) · 2.11 KB
/
ci.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: GitHub CI
# run only on main branch. This avoids duplicated actions on PRs
on:
pull_request:
push:
tags:
- "*"
branches:
- main
env:
MAIN_PYTHON_VERSION: '3.10'
jobs:
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Run protolint
uses: plexsystems/protolint-action@v0.7.0
with:
configDirectory: .
- name: Install build requirements
run: |
pip install -U pip
pip install build
- name: Build
run: python -m build
- name: Install
run: pip install dist/*.whl
- name: Test import
run: |
mkdir tmp
cd tmp
python -c "import ansys.api.geometry.v0; print('Successfully imported ansys.api.geometry.v0')"
python -c "from ansys.api.geometry import __version__; print(__version__)"
- name: Upload packages
uses: actions/upload-artifact@v4
with:
name: ansys-api-geometry-packages
path: dist/
retention-days: 7
release:
name: Release package
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R
- name: Upload to Public PyPi
run: |
pip install twine
twine upload --skip-existing ./**/*.whl
twine upload --skip-existing ./**/*.tar.gz
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
./**/*.whl
./**/*.tar.gz
./**/*.pdf