Skip to content

Commit b60a7fa

Browse files
committed
version 23.5.2
added a script to update version in the buildVars.py automatically if it as not been changed but is confirmed in a commit. this can be used manually, or automatically with a post commit hook. updated sconstruct to generate the required json file for the add-on store. Currently this add-on is not in the add-on store, but I prefer to use the same workflow for all my add-ons. updated buildVars to be compatible with the new sconstruct. now *.json files are ignored. fix the update function to check for the correct asset first, in case of more than one asset in the release.
1 parent abfea4e commit b60a7fa

File tree

6 files changed

+263
-63
lines changed

6 files changed

+263
-63
lines changed

.github/workflows/upload-on-tag.yaml

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1+
permissions:
2+
contents: write
13
name: Upload on new tags
2-
34
on:
45
push:
56
tags:
6-
'*'
7+
['*']
8+
workflow_dispatch:
79

810
jobs:
9-
buildAndUpload:
11+
build:
1012
runs-on: ubuntu-latest
1113
steps:
1214
- name: Checkout code
13-
uses: actions/checkout@v2
14-
- name: Set up Python 3.7
15-
uses: actions/setup-python@v2
15+
uses: actions/checkout@v3
16+
- run: echo -e "pre-commit\nscons\nmarkdown">requirements.txt
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
1619
with:
17-
python-version: 3.7
20+
python-version: 3.9
21+
cache: 'pip'
22+
1823
- name: Install dependencies
1924
run: |
2025
pip install scons markdown
2126
sudo apt update
2227
sudo apt install gettext
28+
2329
- name: Add add-on version
2430
run: |
2531
import re
@@ -31,16 +37,34 @@ jobs:
3137
f.write(text)
3238
f.truncate()
3339
shell: python
40+
3441
- name: Build add-on
3542
run: scons
3643
- name: Calculate sha256
3744
run: sha256sum *.nvda-addon >> changelog.md
45+
46+
- uses: actions/upload-artifact@v3
47+
with:
48+
name: packaged_addon
49+
path: |
50+
./*.nvda-addon
51+
./*.json
52+
53+
upload_release:
54+
runs-on: ubuntu-latest
55+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
56+
needs: ["build"]
57+
steps:
58+
- uses: actions/checkout@v3
59+
- name: download releases files
60+
uses: actions/download-artifact@v3
61+
- name: Display structure of downloaded files
62+
run: ls -R
63+
3864
- name: Release
3965
uses: softprops/action-gh-release@v1
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4266
with:
4367
files: |
44-
*.nvda-addon
45-
body_path: changelog.md
46-
prerelease: ${{ endsWith(github.ref, '-dev') }}
68+
packaged_addon/*.nvda-addon
69+
fail_on_unmatched_files: true
70+
prerelease: ${{ contains(github.ref, '-') }}

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
addon/doc/*.css
22
addon/doc/en/
3-
addon/synthDrivers/ibmtts
43
*_docHandler.py
54
*.html
65
*.ini
76
*.mo
87
*.py[co]
98
*.nvda-addon
10-
*.code-workspace
11-
setup.cfg
129
.sconsign.dblite
10+
*.code-workspace
11+
*.json

addon/globalPlugins/_ibmttsUtils.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,18 @@ def getUpdateInfo(self):
217217
if res.code != 200:
218218
raise RuntimeError(f"Checking for update failed with code {res.code} of url: {self.url}")
219219
data = json.loads(res.read())
220+
asset = None
221+
for k in data['assets']:
222+
if ".nvda-addon" in k['name']:
223+
asset = k
224+
break
225+
if not asset:
226+
raise RuntimeError("Unable to find the package addon file (.add-on) in the asset list")
220227
return {
221228
'version': data['name'],
222-
'name': data['assets'][0]['name'],
223-
'downloadUrl': data['assets'][0]['browser_download_url'],
224-
'releaseDate': time.mktime(time.strptime(data['assets'][0]['updated_at'], "%Y-%m-%dT%H:%M:%SZ"))
229+
'name': asset['name'],
230+
'downloadUrl': asset['browser_download_url'],
231+
'releaseDate': time.mktime(time.strptime(asset['updated_at'], "%Y-%m-%dT%H:%M:%SZ"))
225232
}
226233

227234

buildVars.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager
2020
"addon_description" : _("""This is the IBMTTS synthesizer driver for NVDA."""),
2121
# version
22-
"addon_version" : "v23.02.1",
22+
"addon_version" : "23.5.2",
2323
# Author(s)
2424
"addon_author" : u"David CM <dhf360@gmail.com>, x0 and others",
2525
# URL for the add-on documentation support
@@ -32,6 +32,12 @@
3232
"addon_lastTestedNVDAVersion" : "2023.1.0",
3333
# Add-on update channel (default is stable or None)
3434
"addon_updateChannel" : None,
35+
# Add-on license such as GPL 2
36+
"addon_license": "GPL 2",
37+
# URL for the license document the ad-on is licensed under
38+
"addon_licenseURL": "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html",
39+
# URL for the add-on repository where the source code can be found
40+
"addon_sourceURL": "https://github.com/davidacm/NVDA-IBMTTS-Driver",
3541
}
3642

3743

@@ -50,3 +56,14 @@
5056
# Files that will be ignored when building the nvda-addon file
5157
# Paths are relative to the addon directory, not to the root directory of your addon sources.
5258
excludedFiles = []
59+
60+
61+
# Base language for the NVDA add-on
62+
baseLanguage = "en"
63+
64+
# Markdown extensions for add-on documentation
65+
# Most add-ons do not require additional Markdown extensions.
66+
# If you need to add support for markup such as tables, fill out the below list.
67+
# Extensions string must be of the form "markdown.extensions.extensionName"
68+
# e.g. "markdown.extensions.tables" to add tables.
69+
markdownExtensions = []

0 commit comments

Comments
 (0)