-
Notifications
You must be signed in to change notification settings - Fork 379
116 lines (97 loc) · 3.15 KB
/
pypi.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: codechecker-pypi-package
# Triggers the workflow on 'push', 'pull' and 'release' request events.
# The pypi package will be published only on the release event.
on:
push:
pull_request:
release:
types: [published]
jobs:
build:
name: Build pypi package
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install dependencies
run: |
sudo apt-get update -q
sudo apt-get install g++ gcc-multilib
- name: Get tag version
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
id: get_version
run: |
echo ::set-output name=VERSION::$(echo ${GITHUB_REF#refs/tags/v} | sed 's/-//')
# Set package version information in the 'setup.py' file based on the
# released git tag information.
- name: Set version in the setup.py file
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
run: |
sed -i "s/version=\".*\"/version=\"${{ steps.get_version.outputs.VERSION }}\"/" setup.py
- name: Create the pypi package
run: |
make dist
- uses: actions/upload-artifact@master
with:
name: pypi-package
path: |
dist
tests/functional/binary_package/
test:
name: Install and test pypi package
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [ubuntu-18.04, macos-10.15, windows-2019]
steps:
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- uses: actions/download-artifact@master
with:
name: pypi-package
path: ./
- name: "Install run-time dependencies (Linux)"
if: ${{ matrix.os == 'ubuntu-18.04' }}
run:
sudo apt-get update && sudo apt-get install g++ clang clang-tidy
- name: "Install run-time dependencies (OSX)"
if: ${{ matrix.os == 'macos-10.15' }}
run:
brew install llvm
- name: "Install run-time dependencies (Windows)"
if: ${{ matrix.os == 'windows-2019' }}
shell: powershell
run: |
choco install llvm;
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: "Install pypi package"
shell: bash
run: |
pip install wheel nose
pip install dist/codechecker-*.tar.gz
- name: "Test CodeChecker commands"
run: |
nosetests tests/functional/binary_package/
# Publish pypi package when a new CodeChecker version is released.
publish:
name: Publish pypi package
if: github.event_name == 'release'
runs-on: ubuntu-18.04
needs: test
steps:
- uses: actions/download-artifact@master
with:
name: pypi-package
path: ./
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}