-
Notifications
You must be signed in to change notification settings - Fork 5
145 lines (133 loc) · 4.51 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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CI
on:
workflow_dispatch:
inputs:
build-python-package:
description: Build python package
type: boolean
pull_request:
push:
branches:
- main
tags:
- v*
jobs:
parameters:
name: Parameters
uses: superbox-dev/python-package-workflows/.github/workflows/parameters.yml@main
with:
json: ./.github/workflows/parameters.json
unit-testing:
name: Unit testing
uses: superbox-dev/python-package-workflows/.github/workflows/unit-testing.yml@main
needs:
- parameters
with:
package-name: ${{ needs.parameters.outputs.package-name }}
python-versions: ${{ needs.parameters.outputs.python-versions }}
coverage:
name: Coverage
uses: superbox-dev/python-package-workflows/.github/workflows/coverage.yml@main
needs:
- parameters
- unit-testing
with:
# Workaround: coverage-badge not working with Python 3.12
# Maybe we need an alternative package in the future!
# latest-python-version: ${{ needs.parameters.outputs.latest-python-version }}
latest-python-version: '3.8'
code-analyse:
name: Code analyse
uses: superbox-dev/python-package-workflows/.github/workflows/code-analyse.yml@main
needs:
- parameters
with:
python-versions: ${{ needs.parameters.outputs.python-versions }}
security:
name: Security
uses: superbox-dev/python-package-workflows/.github/workflows/security.yml@main
needs:
- parameters
with:
latest-python-version: ${{ needs.parameters.outputs.latest-python-version }}
build-python-package:
name: Build python package
if: |
github.ref_type == 'tag'
|| (
github.ref_type == 'branch'
&& inputs.build-python-package
)
&& !endsWith(github.ref_name, '/merge')
uses: superbox-dev/python-package-workflows/.github/workflows/build-python-package.yml@main
needs:
- parameters
- unit-testing
- code-analyse
with:
latest-python-version: ${{ needs.parameters.outputs.latest-python-version }}
package-version: ${{ needs.parameters.outputs.package-version }}
build-binary-files:
name: Build binary files
if: |
github.ref_type == 'tag'
|| (
github.ref_type == 'branch'
&& inputs.build-python-package
)
&& !endsWith(github.ref_name, '/merge')
uses: superbox-dev/python-package-workflows/.github/workflows/build-binary-files.yml@main
needs:
- parameters
- unit-testing
- code-analyse
with:
package-version: ${{ needs.parameters.outputs.package-version }}
binary-files: ${{ needs.parameters.outputs.binary-files }}
build-opkg-package:
name: Build OPKG package
needs:
- parameters
- build-binary-files
uses: superbox-dev/python-package-workflows/.github/workflows/build-opkg-package.yml@main
with:
latest-python-version: ${{ needs.parameters.outputs.latest-python-version }}
package-name: ${{ needs.parameters.outputs.package-name }}
package-version: ${{ needs.parameters.outputs.package-version }}
package-maintainer: ${{ needs.parameters.outputs.package-maintainer }}
package-source-url: ${{ needs.parameters.outputs.package-source-url }}
package-description: ${{ needs.parameters.outputs.package-description }}
package-license: ${{ needs.parameters.outputs.package-license }}
release:
name: Release on GitHub
if: github.ref_type == 'tag'
uses: superbox-dev/python-package-workflows/.github/workflows/release.yml@main
needs:
- parameters
- build-python-package
- build-opkg-package
with:
package-name: ${{ needs.parameters.outputs.package-name }}
package-version: ${{ needs.parameters.outputs.package-version }}
publish-on-ftp:
name: Publish on FTP
needs:
- parameters
- build-opkg-package
uses: superbox-dev/python-package-workflows/.github/workflows/publish-on-ftp.yml@main
with:
ftp-hostname: ${{ vars.FTP_HOSTNAME }}
ftp-port: ${{ vars.FTP_PORT }}
ftp-username: ${{ vars.FTP_USERNAME }}
ftp-publish-path: ${{ vars.FTP_PUBLISH_PATH }}
is-dev-version: ${{ needs.parameters.outputs.is-dev-version }}
secrets:
FTP_PASSWORD: ${{ secrets.FILES_SUPERBOX_ONE_FTP_PASSWORD }}
publish-on-pypi:
name: Publish
if: github.ref_type == 'tag'
needs:
- release
uses: superbox-dev/python-package-workflows/.github/workflows/publish-on-pypi.yml@main
secrets:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}