github2gerrit 0.1.2__tar.gz → 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- github2gerrit-0.1.4/.editorconfig +23 -0
- github2gerrit-0.1.4/.github/actionlint.yaml +11 -0
- github2gerrit-0.1.4/.github/dependabot.yml +12 -0
- github2gerrit-0.1.4/.github/release-drafter.yml +68 -0
- github2gerrit-0.1.4/.github/workflows/build-test-release.yaml +324 -0
- github2gerrit-0.1.4/.github/workflows/build-test.yaml +108 -0
- github2gerrit-0.1.4/.github/workflows/dependencies.yaml +48 -0
- github2gerrit-0.1.4/.github/workflows/github2gerrit.yaml +215 -0
- github2gerrit-0.1.4/.github/workflows/release-drafter.yaml +63 -0
- github2gerrit-0.1.4/.github/workflows/semantic-pull-request.yaml +55 -0
- github2gerrit-0.1.4/.github/workflows/sha-pinned-actions.yaml +29 -0
- github2gerrit-0.1.4/.gitignore +67 -0
- github2gerrit-0.1.4/.gitlint +37 -0
- github2gerrit-0.1.4/.pre-commit-config.yaml +125 -0
- github2gerrit-0.1.4/.readthedocs.yml +32 -0
- github2gerrit-0.1.4/.yamllint +13 -0
- github2gerrit-0.1.4/LICENSE +201 -0
- github2gerrit-0.1.4/LICENSES/Apache-2.0.txt +201 -0
- github2gerrit-0.1.2/README.md → github2gerrit-0.1.4/PKG-INFO +122 -5
- github2gerrit-0.1.2/PKG-INFO → github2gerrit-0.1.4/README.md +84 -34
- github2gerrit-0.1.4/REUSE.toml +13 -0
- github2gerrit-0.1.4/action.yaml +278 -0
- github2gerrit-0.1.4/pyproject.toml +157 -0
- github2gerrit-0.1.4/setup.cfg +4 -0
- github2gerrit-0.1.4/sitecustomize.py +155 -0
- github2gerrit-0.1.4/src/github2gerrit/__init__.py +29 -0
- github2gerrit-0.1.4/src/github2gerrit/cli.py +880 -0
- github2gerrit-0.1.4/src/github2gerrit/config.py +329 -0
- github2gerrit-0.1.4/src/github2gerrit/core.py +1850 -0
- github2gerrit-0.1.4/src/github2gerrit/duplicate_detection.py +542 -0
- github2gerrit-0.1.4/src/github2gerrit/github_api.py +333 -0
- github2gerrit-0.1.4/src/github2gerrit/gitutils.py +654 -0
- github2gerrit-0.1.4/src/github2gerrit/models.py +81 -0
- github2gerrit-0.1.4/src/github2gerrit.egg-info/PKG-INFO +553 -0
- github2gerrit-0.1.4/src/github2gerrit.egg-info/SOURCES.txt +60 -0
- github2gerrit-0.1.4/src/github2gerrit.egg-info/dependency_links.txt +1 -0
- github2gerrit-0.1.4/src/github2gerrit.egg-info/entry_points.txt +2 -0
- github2gerrit-0.1.4/src/github2gerrit.egg-info/requires.txt +13 -0
- github2gerrit-0.1.4/src/github2gerrit.egg-info/top_level.txt +1 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_cli.py +20 -1
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_config_helpers.py +44 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_core_ssh_setup.py +33 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_duplicate_detection.py +1 -1
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_gitutils_helpers.py +3 -1
- github2gerrit-0.1.4/uv.lock +430 -0
- github2gerrit-0.1.2/LICENSE +0 -1
- github2gerrit-0.1.2/pyproject.toml +0 -186
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/conftest.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/fixtures/__init__.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/fixtures/make_repo.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_cli_helpers.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_cli_outputs_file.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_cli_url_and_dryrun.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_config_and_reviewers.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_core_close_pr_policy.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_core_config_and_errors.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_core_gerrit_backref_comment.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_core_gerrit_rest_results.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_core_integration_fixture_repo.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_core_prepare_commits.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_ghe_and_gitreview_args.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_github_api_helpers.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_github_api_retry_and_helpers.py +0 -0
- {github2gerrit-0.1.2 → github2gerrit-0.1.4}/tests/test_url_parser.py +0 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
# SPDX-FileCopyrightText: 2025 The Linux Foundation
|
3
|
+
|
4
|
+
root = true
|
5
|
+
|
6
|
+
[*]
|
7
|
+
end_of_line = lf
|
8
|
+
insert_final_newline = true
|
9
|
+
trim_trailing_whitespace = true
|
10
|
+
indent_style = space
|
11
|
+
indent_size = 4
|
12
|
+
|
13
|
+
[*.{json,yaml,yml}]
|
14
|
+
indent_size = 2
|
15
|
+
|
16
|
+
[*.markdown]
|
17
|
+
max_line_length = 80
|
18
|
+
|
19
|
+
[*.py]
|
20
|
+
max_line_legth = 120
|
21
|
+
|
22
|
+
[*.sh]
|
23
|
+
max_line_length = 80
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
3
|
+
# SPDX-FileCopyrightText: 2025 The Linux Foundation
|
4
|
+
|
5
|
+
# Path-specific configurations.
|
6
|
+
paths:
|
7
|
+
.github/workflows/testing.yaml:
|
8
|
+
ignore:
|
9
|
+
# Ignore deliberate test failure
|
10
|
+
- 'input "invalid_input" is not defined in action .+'
|
11
|
+
- 'missing input "input" which is required by action .+'
|
@@ -0,0 +1,68 @@
|
|
1
|
+
---
|
2
|
+
# SPDX-FileCopyrightText: 2025 The Linux Foundation
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
4
|
+
|
5
|
+
name-template: "v$RESOLVED_VERSION"
|
6
|
+
tag-template: "v$RESOLVED_VERSION"
|
7
|
+
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
|
8
|
+
sort-direction: ascending
|
9
|
+
categories:
|
10
|
+
- title: ":boom: Breaking Change :boom:"
|
11
|
+
labels:
|
12
|
+
- "breaking-change"
|
13
|
+
- title: ":zap: Enhancements :zap:"
|
14
|
+
labels:
|
15
|
+
- "enhancement"
|
16
|
+
- title: ":sparkles: New Features :sparkles:"
|
17
|
+
labels:
|
18
|
+
- "feature"
|
19
|
+
- title: ":bug: Bug Fixes :bug:"
|
20
|
+
labels:
|
21
|
+
- "fix"
|
22
|
+
- "bugfix"
|
23
|
+
- "bug"
|
24
|
+
- title: ":wrench: Maintenance :wrench:"
|
25
|
+
labels:
|
26
|
+
- "chore"
|
27
|
+
- "documentation"
|
28
|
+
- "maintenance"
|
29
|
+
- "repo"
|
30
|
+
- "dependencies"
|
31
|
+
- "github_actions"
|
32
|
+
- "refactor"
|
33
|
+
- title: ":mortar_board: Code Quality :mortar_board:"
|
34
|
+
labels:
|
35
|
+
- "code-quality"
|
36
|
+
- "CI"
|
37
|
+
- "test"
|
38
|
+
autolabeler:
|
39
|
+
- label: "breaking-change"
|
40
|
+
title:
|
41
|
+
- "/!:/i"
|
42
|
+
- label: "feature"
|
43
|
+
title:
|
44
|
+
- "/feat:/i"
|
45
|
+
- label: "bug"
|
46
|
+
title:
|
47
|
+
- "/fix:/i"
|
48
|
+
- label: "refactor"
|
49
|
+
title:
|
50
|
+
- "/refactor:/i"
|
51
|
+
- label: "code-quality"
|
52
|
+
title:
|
53
|
+
- "/test:/i"
|
54
|
+
- label: "CI"
|
55
|
+
title:
|
56
|
+
- "/ci:/i"
|
57
|
+
- label: "chore"
|
58
|
+
title:
|
59
|
+
- "/chore:/i"
|
60
|
+
- label: "documentation"
|
61
|
+
title:
|
62
|
+
- "/docs:/i"
|
63
|
+
# yamllint disable rule:line-length
|
64
|
+
template: |
|
65
|
+
$CHANGES
|
66
|
+
|
67
|
+
## Links
|
68
|
+
- [Submit bugs/feature requests](https://github.com/$OWNER/$REPOSITORY/issues)
|
@@ -0,0 +1,324 @@
|
|
1
|
+
---
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
3
|
+
# SPDX-FileCopyrightText: 2025 The Linux Foundation
|
4
|
+
|
5
|
+
# Runs on a new pull request, performs build and runs tests
|
6
|
+
name: 'Python Build/Test/Release'
|
7
|
+
|
8
|
+
# yamllint disable-line rule:truthy
|
9
|
+
on:
|
10
|
+
# Trigger on tag push events
|
11
|
+
push:
|
12
|
+
tags:
|
13
|
+
- '**'
|
14
|
+
|
15
|
+
permissions: {}
|
16
|
+
|
17
|
+
jobs:
|
18
|
+
tag-validate:
|
19
|
+
name: 'Validate Tag Push'
|
20
|
+
runs-on: 'ubuntu-latest'
|
21
|
+
permissions:
|
22
|
+
contents: read
|
23
|
+
timeout-minutes: 1
|
24
|
+
outputs:
|
25
|
+
tag: "${{ steps.tag-validate.outputs.tag }}"
|
26
|
+
should_promote: "${{ steps.check-release.outputs.should_promote }}"
|
27
|
+
steps:
|
28
|
+
# Harden the runner used by this workflow
|
29
|
+
# yamllint disable-line rule:line-length
|
30
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
31
|
+
with:
|
32
|
+
egress-policy: 'audit'
|
33
|
+
|
34
|
+
- name: 'Verify Pushed Tag'
|
35
|
+
id: 'tag-validate'
|
36
|
+
# yamllint disable-line rule:line-length
|
37
|
+
uses: lfreleng-actions/tag-push-verify-action@80e2bdbbb9ee7b67557a31705892b75e75d2859e # v0.1.1
|
38
|
+
with:
|
39
|
+
versioning: 'semver'
|
40
|
+
|
41
|
+
- name: 'Reject Development Tags'
|
42
|
+
if: steps.tag-validate.outputs.dev_version == 'true'
|
43
|
+
shell: bash
|
44
|
+
run: |
|
45
|
+
# Reject Development Tags
|
46
|
+
echo "Development tag pushed; aborting release workflow 🛑"
|
47
|
+
echo "Development tag pushed; aborting release workflow 🛑" \
|
48
|
+
>> "$GITHUB_STEP_SUMMARY"
|
49
|
+
exit 1
|
50
|
+
|
51
|
+
- name: 'Check if release exists'
|
52
|
+
id: 'check-release'
|
53
|
+
shell: bash
|
54
|
+
env:
|
55
|
+
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
56
|
+
run: |
|
57
|
+
TAG="${{ steps.tag-validate.outputs.tag }}"
|
58
|
+
|
59
|
+
# Check if release exists and get its draft status
|
60
|
+
if RELEASE_INFO=$(gh release view "$TAG" --json isDraft \
|
61
|
+
2>/dev/null); then
|
62
|
+
IS_DRAFT=$(echo "$RELEASE_INFO" | jq -r '.isDraft')
|
63
|
+
if [ "$IS_DRAFT" = "false" ]; then
|
64
|
+
echo "should_promote=false" >> "$GITHUB_OUTPUT"
|
65
|
+
echo "Published release already exists for tag $TAG, " \
|
66
|
+
"skipping promotion"
|
67
|
+
else
|
68
|
+
echo "should_promote=true" >> "$GITHUB_OUTPUT"
|
69
|
+
echo "Draft release exists for tag $TAG, " \
|
70
|
+
"will proceed with promotion"
|
71
|
+
fi
|
72
|
+
else
|
73
|
+
echo "should_promote=true" >> "$GITHUB_OUTPUT"
|
74
|
+
echo "No release found for tag $TAG, will proceed with promotion"
|
75
|
+
fi
|
76
|
+
|
77
|
+
python-build:
|
78
|
+
name: 'Python Build'
|
79
|
+
needs: 'tag-validate'
|
80
|
+
runs-on: 'ubuntu-latest'
|
81
|
+
outputs:
|
82
|
+
matrix_json: "${{ steps.python-build.outputs.matrix_json }}"
|
83
|
+
artefact_name: "${{ steps.python-build.outputs.artefact_name }}"
|
84
|
+
artefact_path: "${{ steps.python-build.outputs.artefact_path }}"
|
85
|
+
permissions:
|
86
|
+
contents: read
|
87
|
+
id-token: write # Needed for attestations
|
88
|
+
attestations: write # Needed for attestations
|
89
|
+
timeout-minutes: 12
|
90
|
+
env:
|
91
|
+
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
92
|
+
steps:
|
93
|
+
# Harden the runner used by this workflow
|
94
|
+
# yamllint disable-line rule:line-length
|
95
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
96
|
+
with:
|
97
|
+
egress-policy: 'audit'
|
98
|
+
|
99
|
+
# yamllint disable-line rule:line-length
|
100
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
101
|
+
|
102
|
+
- name: 'Build Python project'
|
103
|
+
id: 'python-build'
|
104
|
+
# yamllint disable-line rule:line-length
|
105
|
+
uses: lfreleng-actions/python-build-action@48381cece78a990a6ba93bd5924bcd40bf0d1a7d # v0.1.20
|
106
|
+
with:
|
107
|
+
sigstore_sign: true
|
108
|
+
attestations: true
|
109
|
+
|
110
|
+
python-tests:
|
111
|
+
name: 'Python Tests'
|
112
|
+
runs-on: 'ubuntu-latest'
|
113
|
+
needs: 'python-build'
|
114
|
+
# Matrix job
|
115
|
+
strategy:
|
116
|
+
fail-fast: false
|
117
|
+
matrix: "${{ fromJson(needs.python-build.outputs.matrix_json) }}"
|
118
|
+
permissions:
|
119
|
+
contents: read
|
120
|
+
timeout-minutes: 12
|
121
|
+
steps:
|
122
|
+
# Harden the runner used by this workflow
|
123
|
+
# yamllint disable-line rule:line-length
|
124
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
125
|
+
with:
|
126
|
+
egress-policy: 'audit'
|
127
|
+
|
128
|
+
# yamllint disable-line rule:line-length
|
129
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
130
|
+
|
131
|
+
- name: 'Test Python project [PYTEST]'
|
132
|
+
# yamllint disable-line rule:line-length
|
133
|
+
uses: lfreleng-actions/python-test-action@bdde9e4e6221e858359f9036bd4f41ab3b1af90e # v0.1.11
|
134
|
+
with:
|
135
|
+
python_version: "${{ matrix.python-version }}"
|
136
|
+
|
137
|
+
python-audit:
|
138
|
+
name: 'Python Audit'
|
139
|
+
runs-on: 'ubuntu-latest'
|
140
|
+
needs: 'python-build'
|
141
|
+
# Matrix job
|
142
|
+
strategy:
|
143
|
+
fail-fast: false
|
144
|
+
matrix: "${{ fromJson(needs.python-build.outputs.matrix_json) }}"
|
145
|
+
permissions:
|
146
|
+
contents: read
|
147
|
+
timeout-minutes: 10
|
148
|
+
steps:
|
149
|
+
# Harden the runner used by this workflow
|
150
|
+
# yamllint disable-line rule:line-length
|
151
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
152
|
+
with:
|
153
|
+
egress-policy: 'audit'
|
154
|
+
|
155
|
+
# yamllint disable-line rule:line-length
|
156
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
157
|
+
|
158
|
+
- name: 'Audit Python project'
|
159
|
+
# yamllint disable-line rule:line-length
|
160
|
+
uses: lfreleng-actions/python-audit-action@bab5316468c108870eb759ef0de622bae9239aad # v0.2.2
|
161
|
+
with:
|
162
|
+
python_version: "${{ matrix.python-version }}"
|
163
|
+
|
164
|
+
test-pypi:
|
165
|
+
name: 'Test PyPI Publishing'
|
166
|
+
runs-on: 'ubuntu-latest'
|
167
|
+
needs:
|
168
|
+
- 'tag-validate'
|
169
|
+
- 'python-tests'
|
170
|
+
- 'python-audit'
|
171
|
+
environment:
|
172
|
+
name: 'development'
|
173
|
+
permissions:
|
174
|
+
contents: read
|
175
|
+
id-token: write # IMPORTANT: mandatory for trusted publishing
|
176
|
+
timeout-minutes: 5
|
177
|
+
steps:
|
178
|
+
# Harden the runner used by this workflow
|
179
|
+
# yamllint disable-line rule:line-length
|
180
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
181
|
+
with:
|
182
|
+
egress-policy: 'audit'
|
183
|
+
|
184
|
+
# yamllint disable-line rule:line-length
|
185
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
186
|
+
|
187
|
+
- name: 'Test PyPI publishing'
|
188
|
+
# yamllint disable-line rule:line-length
|
189
|
+
uses: lfreleng-actions/pypi-publish-action@81a056957ed050f8305760055b1fd8103a916989 # v0.1.1
|
190
|
+
with:
|
191
|
+
environment: 'development'
|
192
|
+
tag: "${{ needs.tag-validate.outputs.tag }}"
|
193
|
+
pypi_credential: "${{ secrets.TEST_PYPI_CREDENTIAL }}"
|
194
|
+
|
195
|
+
pypi:
|
196
|
+
name: 'Release PyPI Package'
|
197
|
+
runs-on: 'ubuntu-latest'
|
198
|
+
needs:
|
199
|
+
- 'tag-validate'
|
200
|
+
- 'test-pypi'
|
201
|
+
environment:
|
202
|
+
name: 'production'
|
203
|
+
permissions:
|
204
|
+
contents: read
|
205
|
+
id-token: write # IMPORTANT: mandatory for trusted publishing
|
206
|
+
timeout-minutes: 5
|
207
|
+
steps:
|
208
|
+
# Harden the runner used by this workflow
|
209
|
+
# yamllint disable-line rule:line-length
|
210
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
211
|
+
with:
|
212
|
+
egress-policy: 'audit'
|
213
|
+
|
214
|
+
# yamllint disable-line rule:line-length
|
215
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
216
|
+
|
217
|
+
- name: 'PyPI release'
|
218
|
+
# yamllint disable-line rule:line-length
|
219
|
+
uses: lfreleng-actions/pypi-publish-action@81a056957ed050f8305760055b1fd8103a916989 # v0.1.1
|
220
|
+
with:
|
221
|
+
environment: 'production'
|
222
|
+
attestations: true
|
223
|
+
tag: "${{ needs.tag-validate.outputs.tag }}"
|
224
|
+
pypi_credential: "${{ secrets.PYPI_CREDENTIAL }}"
|
225
|
+
|
226
|
+
|
227
|
+
promote-release:
|
228
|
+
name: 'Promote Draft Release'
|
229
|
+
# yamllint disable-line rule:line-length
|
230
|
+
if: needs.tag-validate.outputs.should_promote == 'true'
|
231
|
+
needs:
|
232
|
+
- 'tag-validate'
|
233
|
+
- 'pypi'
|
234
|
+
runs-on: 'ubuntu-latest'
|
235
|
+
permissions:
|
236
|
+
contents: write # IMPORTANT: needed to edit a draft release and promote it
|
237
|
+
timeout-minutes: 2
|
238
|
+
outputs:
|
239
|
+
release_url: "${{ steps.promote-release.outputs.release_url }}"
|
240
|
+
steps:
|
241
|
+
# Harden the runner used by this workflow
|
242
|
+
# yamllint disable-line rule:line-length
|
243
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
244
|
+
with:
|
245
|
+
egress-policy: 'audit'
|
246
|
+
|
247
|
+
# yamllint disable-line rule:line-length
|
248
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
249
|
+
|
250
|
+
- name: 'Check if release is already promoted'
|
251
|
+
id: 'check-promoted'
|
252
|
+
shell: bash
|
253
|
+
env:
|
254
|
+
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
255
|
+
run: |
|
256
|
+
TAG="${{ needs.tag-validate.outputs.tag }}"
|
257
|
+
if gh release view "$TAG" --json isDraft --jq '.isDraft' \
|
258
|
+
2>/dev/null | grep -q "false"; then
|
259
|
+
echo "Release $TAG is already promoted, skipping promotion"
|
260
|
+
echo "already_promoted=true" >> "$GITHUB_OUTPUT"
|
261
|
+
else
|
262
|
+
echo "Release $TAG is draft or doesn't exist, " \
|
263
|
+
"proceeding with promotion"
|
264
|
+
echo "already_promoted=false" >> "$GITHUB_OUTPUT"
|
265
|
+
fi
|
266
|
+
|
267
|
+
- name: 'Promote draft release'
|
268
|
+
id: 'promote-release'
|
269
|
+
if: steps.check-promoted.outputs.already_promoted == 'false'
|
270
|
+
# yamllint disable-line rule:line-length
|
271
|
+
uses: lfreleng-actions/draft-release-promote-action@d7e7df12e32fa26b28dbc2f18a12766482785399 # v0.1.2
|
272
|
+
with:
|
273
|
+
token: "${{ secrets.GITHUB_TOKEN }}"
|
274
|
+
tag: "${{ needs.tag-validate.outputs.tag }}"
|
275
|
+
latest: true
|
276
|
+
|
277
|
+
- name: 'Set release URL for already promoted release'
|
278
|
+
if: steps.check-promoted.outputs.already_promoted == 'true'
|
279
|
+
shell: bash
|
280
|
+
env:
|
281
|
+
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
282
|
+
run: |
|
283
|
+
TAG="${{ needs.tag-validate.outputs.tag }}"
|
284
|
+
RELEASE_URL=$(gh release view "$TAG" --json url --jq '.url')
|
285
|
+
echo "release_url=$RELEASE_URL" >> "$GITHUB_OUTPUT"
|
286
|
+
|
287
|
+
# Need to attach build artefacts to the release
|
288
|
+
# This step could potentially be moved
|
289
|
+
# (May be better to when/where the release is still in draft state)
|
290
|
+
attach-artefacts:
|
291
|
+
name: 'Attach Artefacts to Release'
|
292
|
+
runs-on: 'ubuntu-latest'
|
293
|
+
needs:
|
294
|
+
- 'tag-validate'
|
295
|
+
- 'python-build'
|
296
|
+
- 'promote-release'
|
297
|
+
# yamllint disable-line rule:line-length
|
298
|
+
if: always() && (needs.promote-release.result == 'success' || needs.promote-release.result == 'skipped')
|
299
|
+
permissions:
|
300
|
+
contents: write # IMPORTANT: needed to edit release, attach artefacts
|
301
|
+
timeout-minutes: 5
|
302
|
+
steps:
|
303
|
+
# Harden the runner used by this workflow
|
304
|
+
# yamllint disable-line rule:line-length
|
305
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
306
|
+
with:
|
307
|
+
egress-policy: 'audit'
|
308
|
+
|
309
|
+
# Note: no need for a checkout step in this job
|
310
|
+
|
311
|
+
- name: '⬇ Download build artefacts'
|
312
|
+
# yamllint disable-line rule:line-length
|
313
|
+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
314
|
+
with:
|
315
|
+
name: "${{ needs.python-build.outputs.artefact_name }}"
|
316
|
+
path: "${{ needs.python-build.outputs.artefact_path }}"
|
317
|
+
|
318
|
+
- name: 'Attach build artefacts to release'
|
319
|
+
# yamllint disable-line rule:line-length
|
320
|
+
uses: alexellis/upload-assets@13926a61cdb2cb35f5fdef1c06b8b591523236d3 # 0.4.1
|
321
|
+
env:
|
322
|
+
GITHUB_TOKEN: "${{ github.token }}"
|
323
|
+
with:
|
324
|
+
asset_paths: '["${{ needs.python-build.outputs.artefact_path }}/**"]'
|
@@ -0,0 +1,108 @@
|
|
1
|
+
---
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
3
|
+
# SPDX-FileCopyrightText: 2025 The Linux Foundation
|
4
|
+
|
5
|
+
# Runs on a new pull request, performs build and runs tests
|
6
|
+
name: 'Python Build/Test'
|
7
|
+
|
8
|
+
# yamllint disable-line rule:truthy
|
9
|
+
on:
|
10
|
+
workflow_dispatch:
|
11
|
+
pull_request:
|
12
|
+
types: [opened, reopened, edited, synchronize]
|
13
|
+
branches:
|
14
|
+
- main
|
15
|
+
- master
|
16
|
+
paths:
|
17
|
+
- '**'
|
18
|
+
- '!.github/**'
|
19
|
+
- '!.*'
|
20
|
+
- '!tox.ini'
|
21
|
+
|
22
|
+
concurrency:
|
23
|
+
group: "${{ github.workflow }}-${{ github.ref }}"
|
24
|
+
cancel-in-progress: true
|
25
|
+
|
26
|
+
permissions: {}
|
27
|
+
|
28
|
+
jobs:
|
29
|
+
python-build:
|
30
|
+
name: 'Python Build'
|
31
|
+
runs-on: 'ubuntu-latest'
|
32
|
+
outputs:
|
33
|
+
matrix_json: "${{ steps.python-build.outputs.matrix_json }}"
|
34
|
+
artefact_name: "${{ steps.python-build.outputs.artefact_name }}"
|
35
|
+
artefact_path: "${{ steps.python-build.outputs.artefact_path }}"
|
36
|
+
permissions:
|
37
|
+
contents: read
|
38
|
+
timeout-minutes: 12
|
39
|
+
env:
|
40
|
+
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
41
|
+
steps:
|
42
|
+
# Harden the runner used by this workflow
|
43
|
+
# yamllint disable-line rule:line-length
|
44
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
45
|
+
with:
|
46
|
+
egress-policy: 'audit'
|
47
|
+
|
48
|
+
# yamllint disable-line rule:line-length
|
49
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
50
|
+
|
51
|
+
- name: 'Build Python project'
|
52
|
+
id: python-build
|
53
|
+
# yamllint disable-line rule:line-length
|
54
|
+
uses: lfreleng-actions/python-build-action@48381cece78a990a6ba93bd5924bcd40bf0d1a7d # v0.1.20
|
55
|
+
|
56
|
+
python-tests:
|
57
|
+
name: 'Python Tests'
|
58
|
+
runs-on: 'ubuntu-latest'
|
59
|
+
needs: 'python-build'
|
60
|
+
# Matrix job
|
61
|
+
strategy:
|
62
|
+
fail-fast: false
|
63
|
+
matrix: "${{ fromJson(needs.python-build.outputs.matrix_json) }}"
|
64
|
+
permissions:
|
65
|
+
contents: read
|
66
|
+
timeout-minutes: 12
|
67
|
+
steps:
|
68
|
+
# Harden the runner used by this workflow
|
69
|
+
# yamllint disable-line rule:line-length
|
70
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
71
|
+
with:
|
72
|
+
egress-policy: audit
|
73
|
+
|
74
|
+
# yamllint disable-line rule:line-length
|
75
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
76
|
+
|
77
|
+
- name: "Python tests [pytest] ${{ matrix.python-version }}"
|
78
|
+
# yamllint disable-line rule:line-length
|
79
|
+
uses: lfreleng-actions/python-test-action@bdde9e4e6221e858359f9036bd4f41ab3b1af90e # v0.1.11
|
80
|
+
with:
|
81
|
+
python_version: ${{ matrix.python-version }}
|
82
|
+
|
83
|
+
python-audit:
|
84
|
+
name: 'Python Audit'
|
85
|
+
runs-on: 'ubuntu-latest'
|
86
|
+
needs: 'python-build'
|
87
|
+
# Matrix job
|
88
|
+
strategy:
|
89
|
+
fail-fast: false
|
90
|
+
matrix: "${{ fromJson(needs.python-build.outputs.matrix_json) }}"
|
91
|
+
permissions:
|
92
|
+
contents: read
|
93
|
+
timeout-minutes: 10
|
94
|
+
steps:
|
95
|
+
# Harden the runner used by this workflow
|
96
|
+
# yamllint disable-line rule:line-length
|
97
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
98
|
+
with:
|
99
|
+
egress-policy: 'audit'
|
100
|
+
|
101
|
+
# yamllint disable-line rule:line-length
|
102
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
103
|
+
|
104
|
+
- name: "Audit dependencies ${{ matrix.python-version }}"
|
105
|
+
# yamllint disable-line rule:line-length
|
106
|
+
uses: lfreleng-actions/python-audit-action@bab5316468c108870eb759ef0de622bae9239aad # v0.2.2
|
107
|
+
with:
|
108
|
+
python_version: "${{ matrix.python-version }}"
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
3
|
+
# SPDX-FileCopyrightText: 2025 The Linux Foundation
|
4
|
+
|
5
|
+
# Updates Python dependencies and raises a pull request with changes
|
6
|
+
name: 'Dependencies Updates'
|
7
|
+
|
8
|
+
# yamllint disable-line rule:truthy
|
9
|
+
on:
|
10
|
+
workflow_dispatch:
|
11
|
+
schedule:
|
12
|
+
- cron: '0 8 1 * *'
|
13
|
+
push:
|
14
|
+
branches:
|
15
|
+
- 'main'
|
16
|
+
- 'master'
|
17
|
+
paths:
|
18
|
+
- '**'
|
19
|
+
- '!.github/**'
|
20
|
+
- '!.*'
|
21
|
+
- '!tox.ini'
|
22
|
+
|
23
|
+
env:
|
24
|
+
python-version: 3.11
|
25
|
+
|
26
|
+
permissions: {}
|
27
|
+
|
28
|
+
jobs:
|
29
|
+
python-dependencies:
|
30
|
+
name: 'Dependencies Updates'
|
31
|
+
runs-on: 'ubuntu-latest'
|
32
|
+
permissions:
|
33
|
+
# IMPORTANT: mandatory to raise the PR
|
34
|
+
id-token: write
|
35
|
+
pull-requests: write
|
36
|
+
repository-projects: write
|
37
|
+
contents: write
|
38
|
+
timeout-minutes: 10
|
39
|
+
steps:
|
40
|
+
# Harden the runner used by this workflow
|
41
|
+
# yamllint disable-line rule:line-length
|
42
|
+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
43
|
+
with:
|
44
|
+
egress-policy: audit
|
45
|
+
# yamllint disable-line rule:line-length
|
46
|
+
- uses: lfreleng-actions/python-dependencies-update-action@f81d67225c672cddbe56d8234b69868a797c75e7 # v0.1.3
|
47
|
+
with:
|
48
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|