-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathappveyor.yml
More file actions
116 lines (89 loc) · 2.65 KB
/
appveyor.yml
File metadata and controls
116 lines (89 loc) · 2.65 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
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
version: 0.1.{build}
skip_branch_with_pr: true
image: ubuntu
environment:
matrix:
- job_name: Test Python 3.7
job_group: tests
python_version: 3.7
- job_name: Test Python 3.8
job_group: tests
python_version: 3.8
- job_name: Test Python 3.9
job_group: tests
python_version: 3.9
- job_name: Test Python 3.10
job_group: tests
python_version: 3.10
- job_name: Build package
job_group: build
job_depends_on: tests
python_version: 3.10
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: true
pypi_key:
secure: bPSgMbRTG8EIrSW8RUbb8go0xbmg4/E4NnYfGl8h+L+KlWEk5mHLojLG/b6S6nVSCRXEHU/Vc0KjxLO+6mDrC3OT13kwv3fRRT90JNkOIlxePeoEhRFnh3u9nxlxeWncYBayef3U/zdxTTBd4YXqMPZ22qvCqeIRcOi/fzTRrfZ84Wr5V/JS7Jpmzg2yc2B/kzUBiQlfvflY7YUw/QFaiPhYytIglE7XY+r04JwNfgA=
test_pypi_key:
secure: LAsjCb0tqzjUEPxHTq8TPmTDzERQpSS0po96HhXEEczG8EaWqCUdtb+bhT3QLihy+4X4MvErEYXYieUT+KjpuVdgjc/UrqDEuQngBL9r7k5cRMV878c232zbLGljHckNr4TCzHJosANrYBrx0sNg9gVnAoJOxNbu40A1rVB8Qj9ob/eCKwXHHRxfrf0d/NwoLZViCE4toV333tVr5vshlLkQA3oRiS2OZG3VKagTI4nsKCaOFqJHFlvy2a0LEUdc
stack: python $python_version
for:
###############
# Tests #
###############
-
matrix:
only:
- job_group: tests
install:
- python --version
- pip install pdm
- pdm install
build: off
test_script:
- pdm run pytest tests
###############
# Build #
###############
-
matrix:
only:
- job_group: build
install:
- python --version
- pip install --upgrade setuptools wheel twine pdm
- pdm install
test: off
build_script:
- ps: |
$ErrorActionPreference = "Stop"
if ($env:APPVEYOR_REPO_TAG -eq 'true') {
# release mode
# version
$ver = $env:APPVEYOR_REPO_TAG_NAME
if ($ver.StartsWith('v')) { $ver = $ver.Substring(1) }
# prerelease moniker
$idx = $ver.indexOf('-')
if ($idx -ne -1) {
$prerelease = $ver.Substring($idx + 1)
$ver = $ver.Substring(0, $idx)
}
$env:TWINE_PASSWORD = $env:pypi_key
} else {
# build mode
$ver = $env:APPVEYOR_BUILD_VERSION
$env:TWINE_PASSWORD = $env:test_pypi_key
$env:TWINE_REPOSITORY = 'testpypi'
}
# patch version
$env:PACKAGE_VERSION = $ver
(Get-Content pyproject.toml).replace("version = `"0.1.0`"", "version = `"$ver`"") | Set-Content pyproject.toml
# build package
- pdm build
- python3 build-wheels.py
# publish package
- sh: |
if [[ "$APPVEYOR_PULL_REQUEST_NUMBER" == "" ]]; then
twine upload dist/*
fi
artifacts:
path: dist/*