auto-reference-generator 1.3.6__tar.gz → 1.3.8__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.
- auto_reference_generator-1.3.8/.github/workflows/build-portable.yml +329 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/.github/workflows/codeql.yml +5 -4
- auto_reference_generator-1.3.8/.github/workflows/pypi-publish.yml +154 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/.github/workflows/python-tests.yml +9 -5
- auto_reference_generator-1.3.8/.gitignore +10 -0
- auto_reference_generator-1.3.8/.pre-commit-config.yaml +12 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/LICENSE.md +1 -1
- auto_reference_generator-1.3.8/PKG-INFO +455 -0
- auto_reference_generator-1.3.8/README.md +431 -0
- auto_reference_generator-1.3.8/assets/sample_from_dict.json +1 -0
- auto_reference_generator-1.3.8/auto_reference_generator/__init__.py +30 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/auto_reference_generator/cli.py +121 -67
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/auto_reference_generator/common.py +21 -18
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/auto_reference_generator/hash.py +27 -5
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/auto_reference_generator/options/options.properties +7 -2
- auto_reference_generator-1.3.6/auto_reference_generator/reference_generator.py → auto_reference_generator-1.3.8/auto_reference_generator/referenceGen.py +96 -73
- auto_reference_generator-1.3.8/auto_reference_generator.egg-info/PKG-INFO +455 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/auto_reference_generator.egg-info/SOURCES.txt +8 -1
- auto_reference_generator-1.3.8/auto_reference_generator.egg-info/entry_points.txt +2 -0
- auto_reference_generator-1.3.8/installer/README.txt +52 -0
- auto_reference_generator-1.3.8/installer/auto_ref.cmd +14 -0
- auto_reference_generator-1.3.8/installer/install.cmd +79 -0
- auto_reference_generator-1.3.8/installer/uninstall.cmd +43 -0
- auto_reference_generator-1.3.8/optional-requirements.txt +2 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/pyproject.toml +3 -3
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/pytest.ini +2 -2
- auto_reference_generator-1.3.8/requirements.txt +0 -0
- auto_reference_generator-1.3.8/samples/sample_json_dict.json +1 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/tests/test_common.py +1 -1
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/tests/test_hash.py +19 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/tests/test_reference_generator.py +4 -5
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/tests/test_reference_generator_integration.py +1 -1
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/tests/test_reference_loop_and_keywords.py +1 -1
- auto_reference_generator-1.3.6/.github/workflows/build-portable.yml +0 -218
- auto_reference_generator-1.3.6/.github/workflows/pypi-publish.yml +0 -57
- auto_reference_generator-1.3.6/.gitignore +0 -7
- auto_reference_generator-1.3.6/PKG-INFO +0 -350
- auto_reference_generator-1.3.6/README.md +0 -326
- auto_reference_generator-1.3.6/assets/sample_from_dict.json +0 -1
- auto_reference_generator-1.3.6/auto_reference_generator/__init__.py +0 -15
- auto_reference_generator-1.3.6/auto_reference_generator.egg-info/PKG-INFO +0 -350
- auto_reference_generator-1.3.6/auto_reference_generator.egg-info/entry_points.txt +0 -2
- auto_reference_generator-1.3.6/samples/sample_json_dict.json +0 -1
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/assets/AccessionPreview.png +0 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/assets/HashPreview.png +0 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/assets/ReferencesPreview.png +0 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/assets/SpreadGen.png +0 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/assets/SpreadPreview.png +0 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/assets/metaFolder.png +0 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/auto_reference_generator.egg-info/dependency_links.txt +0 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/auto_reference_generator.egg-info/requires.txt +0 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/auto_reference_generator.egg-info/top_level.txt +0 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/samples/auto_reference_generator_AutoRef.xlsx +0 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/samples/auto_reference_generator_AutoRef_from_json.xlsx +0 -0
- {auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/setup.cfg +0 -0
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
name: Build Portable Executables with Nuitka
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '*'
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- 'README.md'
|
|
9
|
+
- 'docs/**'
|
|
10
|
+
- 'assets/**'
|
|
11
|
+
- '.github/**'
|
|
12
|
+
pull_request:
|
|
13
|
+
branches:
|
|
14
|
+
- dev
|
|
15
|
+
- master
|
|
16
|
+
paths-ignore:
|
|
17
|
+
- 'README.md'
|
|
18
|
+
- 'docs/**'
|
|
19
|
+
- 'assets/**'
|
|
20
|
+
- '.github/**'
|
|
21
|
+
|
|
22
|
+
permissions:
|
|
23
|
+
contents: write
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
verify-tag-branch-rule:
|
|
27
|
+
name: Verify Tag Branch Rule
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
outputs:
|
|
30
|
+
should_build: ${{ steps.check-rule.outputs.should_build }}
|
|
31
|
+
publish_release: ${{ steps.check-rule.outputs.publish_release }}
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v6
|
|
34
|
+
with:
|
|
35
|
+
fetch-depth: 0
|
|
36
|
+
- name: Validate tag against branch rule
|
|
37
|
+
id: check-rule
|
|
38
|
+
run: |
|
|
39
|
+
event_name="${{ github.event_name }}"
|
|
40
|
+
tag_name="${{ github.ref_name }}"
|
|
41
|
+
|
|
42
|
+
if [ "$event_name" = "pull_request" ]; then
|
|
43
|
+
echo "should_build=true" >> "$GITHUB_OUTPUT"
|
|
44
|
+
echo "publish_release=false" >> "$GITHUB_OUTPUT"
|
|
45
|
+
echo "Allowed: pull request build only (no release)."
|
|
46
|
+
exit 0
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
git fetch origin master --depth=1
|
|
50
|
+
git fetch origin dev --depth=1
|
|
51
|
+
|
|
52
|
+
on_master=false
|
|
53
|
+
on_dev=false
|
|
54
|
+
|
|
55
|
+
if git merge-base --is-ancestor "$GITHUB_SHA" "origin/master"; then
|
|
56
|
+
on_master=true
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
if git merge-base --is-ancestor "$GITHUB_SHA" "origin/dev"; then
|
|
60
|
+
on_dev=true
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
if [[ "$tag_name" == v* ]] && [[ "$on_master" == true ]]; then
|
|
64
|
+
echo "should_build=true" >> "$GITHUB_OUTPUT"
|
|
65
|
+
echo "publish_release=true" >> "$GITHUB_OUTPUT"
|
|
66
|
+
echo "Allowed: v* tag on master (release build)."
|
|
67
|
+
exit 0
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
if [[ "$on_dev" == true ]]; then
|
|
71
|
+
echo "should_build=true" >> "$GITHUB_OUTPUT"
|
|
72
|
+
echo "publish_release=false" >> "$GITHUB_OUTPUT"
|
|
73
|
+
echo "Allowed: any tag on dev (artifact only)."
|
|
74
|
+
exit 0
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
echo "should_build=false" >> "$GITHUB_OUTPUT"
|
|
78
|
+
echo "publish_release=false" >> "$GITHUB_OUTPUT"
|
|
79
|
+
echo "Blocked: event does not meet PR or tag branch rules."
|
|
80
|
+
|
|
81
|
+
build-windows:
|
|
82
|
+
name: Build Windows Portable
|
|
83
|
+
runs-on: windows-latest
|
|
84
|
+
needs: verify-tag-branch-rule
|
|
85
|
+
if: needs.verify-tag-branch-rule.outputs.should_build == 'true'
|
|
86
|
+
steps:
|
|
87
|
+
- uses: actions/checkout@v6
|
|
88
|
+
with:
|
|
89
|
+
persist-credentials: false
|
|
90
|
+
|
|
91
|
+
- name: Set up Python
|
|
92
|
+
uses: actions/setup-python@v6
|
|
93
|
+
with:
|
|
94
|
+
python-version: '3.11'
|
|
95
|
+
|
|
96
|
+
- name: Install dependencies
|
|
97
|
+
run: |
|
|
98
|
+
choco install llvm -y
|
|
99
|
+
python -m pip install --upgrade pip
|
|
100
|
+
pip install nuitka ordered-set zstandard odfpy lxml
|
|
101
|
+
pip install -e .
|
|
102
|
+
|
|
103
|
+
- name: Build Windows executable with Nuitka
|
|
104
|
+
env:
|
|
105
|
+
NUITKA_CACHE_DIR: ${{ runner.temp }}/nuitka_cache
|
|
106
|
+
run: |
|
|
107
|
+
$tag = "${{ github.ref_name }}"
|
|
108
|
+
$version = [regex]::Match($tag, '\d+\.\d+\.\d+').Value
|
|
109
|
+
if ($version -eq "") { $version = "1.0.0" }
|
|
110
|
+
python -m nuitka `
|
|
111
|
+
--onefile `
|
|
112
|
+
--follow-imports `
|
|
113
|
+
--windows-console-mode=force `
|
|
114
|
+
-o auto_ref `
|
|
115
|
+
--output-dir=build `
|
|
116
|
+
--nofollow-import-to=pandas.tests `
|
|
117
|
+
--nofollow-import-to=pandas.conftest `
|
|
118
|
+
--include-package=odf `
|
|
119
|
+
--include-package=lxml `
|
|
120
|
+
--include-package=pandas `
|
|
121
|
+
--include-package=auto_reference_generator `
|
|
122
|
+
--include-data-dir=auto_reference_generator/options=options `
|
|
123
|
+
--company-name="Auto Reference Generator" `
|
|
124
|
+
--product-name="Auto Reference Generator" `
|
|
125
|
+
--file-version="$version" `
|
|
126
|
+
--product-version="$version" `
|
|
127
|
+
--copyright="Copyright $(Get-Date -Format yyyy)" `
|
|
128
|
+
--assume-yes-for-downloads `
|
|
129
|
+
--quiet `
|
|
130
|
+
--clang `
|
|
131
|
+
auto_reference_generator/cli.py
|
|
132
|
+
|
|
133
|
+
- name: Create Windows package
|
|
134
|
+
run: |
|
|
135
|
+
$version = "${{ github.ref_name }}" -replace "^v", ""
|
|
136
|
+
if ($version -eq "") { $version = "1.0.0" }
|
|
137
|
+
|
|
138
|
+
# Create folder structure
|
|
139
|
+
New-Item -ItemType Directory -Force -Path "auto_ref/bin" | Out-Null
|
|
140
|
+
|
|
141
|
+
# Copy executable and wrapper
|
|
142
|
+
Copy-Item -Path "build/auto_ref.exe" -Destination "auto_ref/bin/"
|
|
143
|
+
Copy-Item -Path "installer/auto_ref.cmd" -Destination "auto_ref/bin/"
|
|
144
|
+
|
|
145
|
+
# Copy documentation and scripts
|
|
146
|
+
Copy-Item -Path "installer/README.txt" -Destination "auto_ref/"
|
|
147
|
+
Copy-Item -Path "installer/install.cmd" -Destination "auto_ref/"
|
|
148
|
+
Copy-Item -Path "installer/uninstall.cmd" -Destination "auto_ref/"
|
|
149
|
+
Copy-Item -Path "LICENSE.md" -Destination "auto_ref/" -ErrorAction SilentlyContinue
|
|
150
|
+
|
|
151
|
+
# Create portable ZIP
|
|
152
|
+
Compress-Archive -Path "auto_ref" -DestinationPath "auto_ref_windows_$version.zip"
|
|
153
|
+
|
|
154
|
+
- name: Upload Windows artifact
|
|
155
|
+
uses: actions/upload-artifact@v4
|
|
156
|
+
with:
|
|
157
|
+
name: auto_ref-windows
|
|
158
|
+
path: auto_ref_windows_*.zip
|
|
159
|
+
|
|
160
|
+
- name: Upload to release
|
|
161
|
+
if: needs.verify-tag-branch-rule.outputs.publish_release == 'true'
|
|
162
|
+
uses: softprops/action-gh-release@v1
|
|
163
|
+
with:
|
|
164
|
+
draft: true
|
|
165
|
+
files: auto_ref_windows_*.zip
|
|
166
|
+
env:
|
|
167
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
168
|
+
|
|
169
|
+
build-linux:
|
|
170
|
+
name: Build Linux Portable
|
|
171
|
+
runs-on: ubuntu-latest
|
|
172
|
+
needs: verify-tag-branch-rule
|
|
173
|
+
if: needs.verify-tag-branch-rule.outputs.should_build == 'true'
|
|
174
|
+
steps:
|
|
175
|
+
- uses: actions/checkout@v6
|
|
176
|
+
with:
|
|
177
|
+
persist-credentials: false
|
|
178
|
+
|
|
179
|
+
- name: Set up Python
|
|
180
|
+
uses: actions/setup-python@v6
|
|
181
|
+
with:
|
|
182
|
+
python-version: '3.11'
|
|
183
|
+
|
|
184
|
+
- name: Install system dependencies
|
|
185
|
+
run: |
|
|
186
|
+
sudo apt-get update
|
|
187
|
+
sudo apt-get install -y patchelf clang
|
|
188
|
+
|
|
189
|
+
- name: Install Python dependencies
|
|
190
|
+
run: |
|
|
191
|
+
python -m pip install --upgrade pip
|
|
192
|
+
pip install nuitka ordered-set zstandard odfpy lxml
|
|
193
|
+
pip install -e .
|
|
194
|
+
|
|
195
|
+
- name: Build Linux executable with Nuitka
|
|
196
|
+
run: |
|
|
197
|
+
python -m nuitka \
|
|
198
|
+
--onefile \
|
|
199
|
+
--follow-imports \
|
|
200
|
+
-o auto_ref \
|
|
201
|
+
--output-dir=build \
|
|
202
|
+
--nofollow-import-to=pandas.tests \
|
|
203
|
+
--nofollow-import-to=pandas.conftest \
|
|
204
|
+
--include-package=odf \
|
|
205
|
+
--include-package=lxml \
|
|
206
|
+
--include-package=pandas \
|
|
207
|
+
--include-package=auto_reference_generator \
|
|
208
|
+
--include-data-dir=auto_reference_generator/options=options \
|
|
209
|
+
--assume-yes-for-downloads \
|
|
210
|
+
--quiet \
|
|
211
|
+
--clang \
|
|
212
|
+
auto_reference_generator/cli.py
|
|
213
|
+
|
|
214
|
+
- name: Create Linux artifact archive
|
|
215
|
+
run: |
|
|
216
|
+
version="${{ github.ref_name }}"
|
|
217
|
+
version="${version#v}"
|
|
218
|
+
version="${version#test-}"
|
|
219
|
+
if [ -z "$version" ] || [ "$version" = "master" ]; then
|
|
220
|
+
version="1.0.0"
|
|
221
|
+
fi
|
|
222
|
+
tar -czf "auto_ref_linux_${version}.tar.gz" -C build auto_ref
|
|
223
|
+
|
|
224
|
+
- name: Upload Linux artifact
|
|
225
|
+
uses: actions/upload-artifact@v4
|
|
226
|
+
with:
|
|
227
|
+
name: auto_ref-linux
|
|
228
|
+
path: auto_ref_linux_*.tar.gz
|
|
229
|
+
|
|
230
|
+
- name: Upload to release
|
|
231
|
+
if: needs.verify-tag-branch-rule.outputs.publish_release == 'true'
|
|
232
|
+
uses: softprops/action-gh-release@v1
|
|
233
|
+
with:
|
|
234
|
+
draft: true
|
|
235
|
+
files: auto_ref_linux_*.tar.gz
|
|
236
|
+
env:
|
|
237
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
238
|
+
|
|
239
|
+
build-macos:
|
|
240
|
+
name: Build macOS Portable
|
|
241
|
+
runs-on: macos-latest
|
|
242
|
+
needs: verify-tag-branch-rule
|
|
243
|
+
if: needs.verify-tag-branch-rule.outputs.should_build == 'true'
|
|
244
|
+
steps:
|
|
245
|
+
- uses: actions/checkout@v6
|
|
246
|
+
with:
|
|
247
|
+
persist-credentials: false
|
|
248
|
+
|
|
249
|
+
- name: Set up Python
|
|
250
|
+
uses: actions/setup-python@v6
|
|
251
|
+
with:
|
|
252
|
+
python-version: '3.11'
|
|
253
|
+
|
|
254
|
+
- name: Install Python dependencies
|
|
255
|
+
run: |
|
|
256
|
+
python -m pip install --upgrade pip
|
|
257
|
+
pip install nuitka ordered-set zstandard odfpy lxml
|
|
258
|
+
pip install -e .
|
|
259
|
+
|
|
260
|
+
- name: Build macOS executable with Nuitka
|
|
261
|
+
run: |
|
|
262
|
+
python -m nuitka \
|
|
263
|
+
--onefile \
|
|
264
|
+
--follow-imports \
|
|
265
|
+
-o auto_ref \
|
|
266
|
+
--nofollow-import-to=pandas.tests \
|
|
267
|
+
--nofollow-import-to=pandas.conftest \
|
|
268
|
+
--output-dir=build \
|
|
269
|
+
--include-package=odf \
|
|
270
|
+
--include-package=lxml \
|
|
271
|
+
--include-package=pandas \
|
|
272
|
+
--include-package=auto_reference_generator \
|
|
273
|
+
--include-data-dir=auto_reference_generator/options=options \
|
|
274
|
+
--macos-create-app-bundle \
|
|
275
|
+
--assume-yes-for-downloads \
|
|
276
|
+
--quiet \
|
|
277
|
+
--clang \
|
|
278
|
+
auto_reference_generator/cli.py
|
|
279
|
+
|
|
280
|
+
- name: Create macOS artifact archive
|
|
281
|
+
run: |
|
|
282
|
+
version="${{ github.ref_name }}"
|
|
283
|
+
version="${version#v}"
|
|
284
|
+
version="${version#test-}"
|
|
285
|
+
if [ -z "$version" ] || [ "$version" = "master" ]; then
|
|
286
|
+
version="1.0.0"
|
|
287
|
+
fi
|
|
288
|
+
tar -czf "auto_ref_macos_${version}.tar.gz" -C build auto_ref
|
|
289
|
+
|
|
290
|
+
- name: Upload macOS artifact
|
|
291
|
+
uses: actions/upload-artifact@v5
|
|
292
|
+
with:
|
|
293
|
+
name: auto_ref-macos
|
|
294
|
+
path: auto_ref_macos_*.tar.gz
|
|
295
|
+
|
|
296
|
+
- name: Upload to release
|
|
297
|
+
if: needs.verify-tag-branch-rule.outputs.publish_release == 'true'
|
|
298
|
+
uses: softprops/action-gh-release@v1
|
|
299
|
+
with:
|
|
300
|
+
draft: true
|
|
301
|
+
files: auto_ref_macos_*.tar.gz
|
|
302
|
+
env:
|
|
303
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
304
|
+
|
|
305
|
+
create-release-notes:
|
|
306
|
+
name: Create Release Notes
|
|
307
|
+
runs-on: ubuntu-latest
|
|
308
|
+
needs: [verify-tag-branch-rule, build-windows, build-linux, build-macos]
|
|
309
|
+
if: needs.verify-tag-branch-rule.outputs.publish_release == 'true'
|
|
310
|
+
steps:
|
|
311
|
+
- uses: actions/checkout@v6
|
|
312
|
+
with:
|
|
313
|
+
persist-credentials: false
|
|
314
|
+
|
|
315
|
+
- name: Generate Release Notes
|
|
316
|
+
run: |
|
|
317
|
+
echo "## Portable Executables" > release_notes.md
|
|
318
|
+
echo "" >> release_notes.md
|
|
319
|
+
echo "### Downloads" >> release_notes.md
|
|
320
|
+
echo "- **Windows**: \`auto_ref_windows_\`" >> release_notes.md
|
|
321
|
+
echo "- **Linux**: \`auto_ref_linux_\`" >> release_notes.md
|
|
322
|
+
echo "- **macOS**: \`auto_ref_macos_\`" >> release_notes.md
|
|
323
|
+
echo "" >> release_notes.md
|
|
324
|
+
echo "These are standalone executables that do not require Python to be installed." >> release_notes.md
|
|
325
|
+
echo "" >> release_notes.md
|
|
326
|
+
echo "### Usage" >> release_notes.md
|
|
327
|
+
echo "\`\`\`bash" >> release_notes.md
|
|
328
|
+
echo "./auto_ref /path/to/root -p PREFIX -o /path/to/output" >> release_notes.md
|
|
329
|
+
echo "\`\`\`" >> release_notes.md
|
{auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/.github/workflows/codeql.yml
RENAMED
|
@@ -15,16 +15,17 @@ on:
|
|
|
15
15
|
push:
|
|
16
16
|
tags:
|
|
17
17
|
- 'v*'
|
|
18
|
-
|
|
18
|
+
branches:
|
|
19
|
+
- 'dev'
|
|
19
20
|
paths-ignore:
|
|
20
21
|
- 'README.md'
|
|
21
22
|
- 'docs/**'
|
|
22
23
|
- 'assets/**'
|
|
23
24
|
- '.github/**'
|
|
24
25
|
pull_request:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
branches:
|
|
27
|
+
- master
|
|
28
|
+
- dev
|
|
28
29
|
paths-ignore:
|
|
29
30
|
- 'README.md'
|
|
30
31
|
- 'docs/**'
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
name: Publish Python distribution to PyPI and TestPyPi
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '*'
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- 'README.md'
|
|
9
|
+
- 'docs/**'
|
|
10
|
+
- 'assets/**'
|
|
11
|
+
- '.github/**'
|
|
12
|
+
pull_request:
|
|
13
|
+
branches:
|
|
14
|
+
- dev
|
|
15
|
+
- master
|
|
16
|
+
paths-ignore:
|
|
17
|
+
- 'README.md'
|
|
18
|
+
- 'docs/**'
|
|
19
|
+
- 'assets/**'
|
|
20
|
+
- '.github/**'
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
verify-tag-branch-rule:
|
|
24
|
+
name: Verify Tag Branch Rule
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
outputs:
|
|
27
|
+
should_build: ${{ steps.check-rule.outputs.should_build }}
|
|
28
|
+
publish_testpypi: ${{ steps.check-rule.outputs.publish_testpypi }}
|
|
29
|
+
publish_pypi: ${{ steps.check-rule.outputs.publish_pypi }}
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v6
|
|
32
|
+
with:
|
|
33
|
+
fetch-depth: 0
|
|
34
|
+
- name: Validate tag against branch rule
|
|
35
|
+
id: check-rule
|
|
36
|
+
run: |
|
|
37
|
+
event_name="${{ github.event_name }}"
|
|
38
|
+
tag_name="${{ github.ref_name }}"
|
|
39
|
+
|
|
40
|
+
if [ "$event_name" = "pull_request" ]; then
|
|
41
|
+
echo "should_build=true" >> "$GITHUB_OUTPUT"
|
|
42
|
+
echo "publish_testpypi=false" >> "$GITHUB_OUTPUT"
|
|
43
|
+
echo "publish_pypi=false" >> "$GITHUB_OUTPUT"
|
|
44
|
+
echo "Allowed: pull request build only (no publish)."
|
|
45
|
+
exit 0
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
git fetch origin master --depth=1
|
|
49
|
+
git fetch origin dev --depth=1
|
|
50
|
+
|
|
51
|
+
on_master=false
|
|
52
|
+
on_dev=false
|
|
53
|
+
|
|
54
|
+
if git merge-base --is-ancestor "$GITHUB_SHA" "origin/master"; then
|
|
55
|
+
on_master=true
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
if git merge-base --is-ancestor "$GITHUB_SHA" "origin/dev"; then
|
|
59
|
+
on_dev=true
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
if [[ "$tag_name" == v* ]] && [[ "$on_master" == true ]]; then
|
|
63
|
+
echo "should_build=true" >> "$GITHUB_OUTPUT"
|
|
64
|
+
echo "publish_testpypi=false" >> "$GITHUB_OUTPUT"
|
|
65
|
+
echo "publish_pypi=true" >> "$GITHUB_OUTPUT"
|
|
66
|
+
echo "Allowed: v* tag on master (PyPI only)."
|
|
67
|
+
exit 0
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
if [[ "$on_dev" == true ]]; then
|
|
71
|
+
echo "should_build=true" >> "$GITHUB_OUTPUT"
|
|
72
|
+
echo "publish_testpypi=true" >> "$GITHUB_OUTPUT"
|
|
73
|
+
echo "publish_pypi=false" >> "$GITHUB_OUTPUT"
|
|
74
|
+
echo "Allowed: any tag on dev (TestPyPI only)."
|
|
75
|
+
exit 0
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
echo "should_build=false" >> "$GITHUB_OUTPUT"
|
|
79
|
+
echo "publish_testpypi=false" >> "$GITHUB_OUTPUT"
|
|
80
|
+
echo "publish_pypi=false" >> "$GITHUB_OUTPUT"
|
|
81
|
+
echo "Blocked: event does not meet PR or tag branch rules."
|
|
82
|
+
|
|
83
|
+
build:
|
|
84
|
+
name: Build distribution
|
|
85
|
+
runs-on: ubuntu-latest
|
|
86
|
+
needs: verify-tag-branch-rule
|
|
87
|
+
if: needs.verify-tag-branch-rule.outputs.should_build == 'true'
|
|
88
|
+
steps:
|
|
89
|
+
- uses: actions/checkout@v6
|
|
90
|
+
with:
|
|
91
|
+
persist-credentials: false
|
|
92
|
+
- name: Set up Python
|
|
93
|
+
uses: actions/setup-python@v6
|
|
94
|
+
with:
|
|
95
|
+
python-version: "3.x"
|
|
96
|
+
- name: Install pypa/build
|
|
97
|
+
run: >-
|
|
98
|
+
python3 -m
|
|
99
|
+
pip install
|
|
100
|
+
build
|
|
101
|
+
- name: Build a binary wheel and a source tarball
|
|
102
|
+
run: python3 -m build
|
|
103
|
+
- name: Store the distribution packages
|
|
104
|
+
uses: actions/upload-artifact@v5
|
|
105
|
+
with:
|
|
106
|
+
name: python-package-distributions
|
|
107
|
+
path: dist/
|
|
108
|
+
|
|
109
|
+
publish-to-testpypi:
|
|
110
|
+
name: >-
|
|
111
|
+
Publish Python distribution to TestPyPI
|
|
112
|
+
needs:
|
|
113
|
+
- verify-tag-branch-rule
|
|
114
|
+
- build
|
|
115
|
+
if: needs.verify-tag-branch-rule.outputs.publish_testpypi == 'true'
|
|
116
|
+
runs-on: ubuntu-latest
|
|
117
|
+
environment:
|
|
118
|
+
name: testpypi
|
|
119
|
+
url: https://test.pypi.org/p/auto-reference-generator # Replace <package-name> with your TestPyPI project name
|
|
120
|
+
permissions:
|
|
121
|
+
id-token: write # IMPORTANT: mandatory for trusted publishing
|
|
122
|
+
steps:
|
|
123
|
+
- name: Download all the dists
|
|
124
|
+
uses: actions/download-artifact@v6
|
|
125
|
+
with:
|
|
126
|
+
name: python-package-distributions
|
|
127
|
+
path: dist/
|
|
128
|
+
- name: Publish distribution to TestPyPI
|
|
129
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
130
|
+
with:
|
|
131
|
+
repository-url: https://test.pypi.org/legacy/
|
|
132
|
+
|
|
133
|
+
publish-to-pypi:
|
|
134
|
+
name: >-
|
|
135
|
+
Publish Python distribution to PyPI
|
|
136
|
+
needs:
|
|
137
|
+
- verify-tag-branch-rule
|
|
138
|
+
- build
|
|
139
|
+
if: needs.verify-tag-branch-rule.outputs.publish_pypi == 'true'
|
|
140
|
+
runs-on: ubuntu-latest
|
|
141
|
+
environment:
|
|
142
|
+
name: pypi
|
|
143
|
+
url: https://pypi.org/p/auto-reference-generator # Replace <package-name> with your PyPI project name
|
|
144
|
+
permissions:
|
|
145
|
+
id-token: write # IMPORTANT: mandatory for trusted publishing
|
|
146
|
+
|
|
147
|
+
steps:
|
|
148
|
+
- name: Download all the dists
|
|
149
|
+
uses: actions/download-artifact@v6
|
|
150
|
+
with:
|
|
151
|
+
name: python-package-distributions
|
|
152
|
+
path: dist/
|
|
153
|
+
- name: Publish distribution to PyPI
|
|
154
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
{auto_reference_generator-1.3.6 → auto_reference_generator-1.3.8}/.github/workflows/python-tests.yml
RENAMED
|
@@ -4,20 +4,24 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
tags:
|
|
6
6
|
- 'v*'
|
|
7
|
-
|
|
7
|
+
branches:
|
|
8
|
+
- 'dev'
|
|
8
9
|
paths-ignore:
|
|
9
10
|
- 'README.md'
|
|
10
11
|
- 'docs/**'
|
|
11
12
|
- 'assets/**'
|
|
12
13
|
- '.github/**'
|
|
13
14
|
pull_request:
|
|
14
|
-
branches:
|
|
15
|
+
branches:
|
|
16
|
+
- master
|
|
17
|
+
- dev
|
|
15
18
|
paths-ignore:
|
|
16
19
|
- 'README.md'
|
|
17
20
|
- 'docs/**'
|
|
18
21
|
- 'assets/**'
|
|
19
22
|
- '.github/**'
|
|
20
|
-
|
|
23
|
+
workflow_dispatch: {}
|
|
24
|
+
|
|
21
25
|
jobs:
|
|
22
26
|
build:
|
|
23
27
|
runs-on: ubuntu-latest
|
|
@@ -31,7 +35,7 @@ jobs:
|
|
|
31
35
|
uses: actions/setup-python@v4
|
|
32
36
|
with:
|
|
33
37
|
python-version: ${{ matrix.python-version }}
|
|
34
|
-
|
|
38
|
+
|
|
35
39
|
- name: Install dependencies
|
|
36
40
|
run: |
|
|
37
41
|
python -m pip install --upgrade pip
|
|
@@ -39,4 +43,4 @@ jobs:
|
|
|
39
43
|
|
|
40
44
|
- name: Run tests
|
|
41
45
|
run: |
|
|
42
|
-
python -m pytest -v
|
|
46
|
+
python -m pytest -v
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/igrr/argparse_to_md.git
|
|
3
|
+
rev: v0.4.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: argparse_to_md
|
|
6
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
7
|
+
rev: v4.5.0
|
|
8
|
+
hooks:
|
|
9
|
+
- id: check-yaml
|
|
10
|
+
- id: end-of-file-fixer
|
|
11
|
+
- id: trailing-whitespace
|
|
12
|
+
exclude: ^README\.md$
|
|
@@ -199,4 +199,4 @@
|
|
|
199
199
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
200
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
201
|
See the License for the specific language governing permissions and
|
|
202
|
-
limitations under the License.
|
|
202
|
+
limitations under the License.
|