From a31485840d39896daff9fbf37a3a7da27998532c Mon Sep 17 00:00:00 2001 From: David CM Date: Thu, 4 Jan 2024 23:45:03 -0600 Subject: [PATCH] version 24.1.1 * updated support for NVDA 2024.2. * updated the release github workflow, to use the first header content as the release description. --- .github/workflows/release-on-tag.yaml | 69 +++++++++++++++++++++++++ .github/workflows/upload-on-tag.yaml | 71 -------------------------- addon/globalPlugins/headphoneFinder.py | 2 +- buildVars.py | 4 +- changelog.md | 9 +++- sconstruct | 12 +++-- style.css | 4 -- 7 files changed, 88 insertions(+), 83 deletions(-) create mode 100644 .github/workflows/release-on-tag.yaml delete mode 100644 .github/workflows/upload-on-tag.yaml diff --git a/.github/workflows/release-on-tag.yaml b/.github/workflows/release-on-tag.yaml new file mode 100644 index 0000000..4c93430 --- /dev/null +++ b/.github/workflows/release-on-tag.yaml @@ -0,0 +1,69 @@ +permissions: + contents: write +name: Upload on new tags +on: + push: + tags: + ['*'] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - run: echo -e "scons\nmarkdown">requirements.txt + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + cache: 'pip' + - name: Install dependencies + run: | + pip install scons markdown + sudo apt update + sudo apt install gettext + + - name: Set add-on version from tag + run: | + import re + with open("buildVars.py", 'r+', encoding='utf-8') as f: + text = f.read() + version = "${{ github.ref }}".split("/")[-1] + text = re.sub('"addon_version" *:.*,', '"addon_version" : "%s",' % version, text) + f.seek(0) + f.write(text) + f.truncate() + shell: python + + - name: Build add-on + run: scons + - name: load latest changes from changelog + run: awk '/^# / && !flag {flag=1; next} /^# / && flag {exit} flag && NF' changelog.md > newChanges.md + - name: Calculate sha256 + run: sha256sum *.nvda-addon >> newChanges.md + - uses: actions/upload-artifact@v3 + with: + name: packaged_addon + path: | + ./*.nvda-addon + ./newChanges.md + + upload_release: + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/') }} + needs: ["build"] + steps: + - name: download releases files + uses: actions/download-artifact@v3 + - name: Display structure of downloaded files + run: ls -R + + - name: Release + uses: softprops/action-gh-release@v1 + with: + body_path: packaged_addon/newChanges.md + files: packaged_addon/*.nvda-addon + fail_on_unmatched_files: true + prerelease: ${{ contains(github.ref, '-') }} diff --git a/.github/workflows/upload-on-tag.yaml b/.github/workflows/upload-on-tag.yaml deleted file mode 100644 index 49641b3..0000000 --- a/.github/workflows/upload-on-tag.yaml +++ /dev/null @@ -1,71 +0,0 @@ -permissions: - contents: write -name: Upload on new tags -on: - push: - tags: - ['*'] - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - run: echo -e "pre-commit\nscons\nmarkdown">requirements.txt - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - cache: 'pip' - - - name: Install dependencies - run: | - pip install scons markdown - sudo apt update - sudo apt install gettext - - - name: Add add-on version - run: | - import re - with open("buildVars.py", 'r+', encoding='utf-8') as f: - text = f.read() - version = "${{ github.ref }}".split("/")[-1] - text = re.sub('"addon_version" *:.*,', '"addon_version" : "%s",' % version, text) - f.seek(0) - f.write(text) - f.truncate() - shell: python - - - name: Build add-on - run: scons - - name: Calculate sha256 - run: sha256sum *.nvda-addon >> changelog.md - - - uses: actions/upload-artifact@v3 - with: - name: packaged_addon - path: | - ./*.nvda-addon - ./*.json - - upload_release: - runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/') }} - needs: ["build"] - steps: - - uses: actions/checkout@v3 - - name: download releases files - uses: actions/download-artifact@v3 - - name: Display structure of downloaded files - run: ls -R - - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: | - packaged_addon/*.nvda-addon - packaged_addon/*.json - fail_on_unmatched_files: true - prerelease: ${{ contains(github.ref, '-') }} diff --git a/addon/globalPlugins/headphoneFinder.py b/addon/globalPlugins/headphoneFinder.py index 2ff90f0..0a78013 100644 --- a/addon/globalPlugins/headphoneFinder.py +++ b/addon/globalPlugins/headphoneFinder.py @@ -1,6 +1,6 @@ # -*- coding: UTF-8 -*- # Headphone Finder: """This add-on has two scripts, to beep to the left or the right, this can help you to find your bluetooth headphone. -# Copyright (C) 2023 David CM +# Copyright (C) 2023 - 2024 David CM # Author: David CM # Released under GPL 2 #globalPlugins/headphoneFinder.py diff --git a/buildVars.py b/buildVars.py index 278e0cd..71ee35a 100644 --- a/buildVars.py +++ b/buildVars.py @@ -19,7 +19,7 @@ # Translators: Long description to be shown for this add-on on add-on information from add-ons manager "addon_description" : _("""This add-on has two scripts, to beep to the left or the right, this can help you to find your bluetooth headphone."""), # version - "addon_version" : "0.1", + "addon_version" : "24.1.1", # Author(s) "addon_author" : u"David CM ", # URL for the add-on documentation support @@ -29,7 +29,7 @@ # Minimum NVDA version supported (e.g. "2018.3.0") "addon_minimumNVDAVersion" : "2018.3.0", # Last NVDA version supported/tested (e.g. "2018.4.0", ideally more recent than minimum version) - "addon_lastTestedNVDAVersion" : "2023.1.0", + "addon_lastTestedNVDAVersion" : "2024.2.0", # Add-on update channel (default is stable or None) "addon_updateChannel" : None, # Add-on license such as GPL 2 diff --git a/changelog.md b/changelog.md index d160dbb..4d2cc20 100644 --- a/changelog.md +++ b/changelog.md @@ -1,2 +1,7 @@ -## 0.1 version ## -The first version. +# version 24.1.1 + +* updated support for NVDA 2024.2. + +# version 0.1 + +* The first version. diff --git a/sconstruct b/sconstruct index 8aa914b..dde28af 100644 --- a/sconstruct +++ b/sconstruct @@ -101,7 +101,7 @@ if env["dev"]: buildDate = datetime.datetime.now() year, month, day = str(buildDate.year), str(buildDate.month), str(buildDate.day) versionTimestamp = "".join([year, month.zfill(2), day.zfill(2)]) - env["addon_version"] = f"{versionTimestamp}-dev" + env["addon_version"] = f"{versionTimestamp}.0.0" env["versionNumber"] = f"{versionTimestamp}.0.0" env["channel"] = "dev" elif env["version"] is not None: @@ -170,7 +170,8 @@ def createAddonBundleFromPath(path, dest): absPath = os.path.join(dir, filename) if pathInBundle not in buildVars.excludedFiles: z.write(absPath, pathInBundle) - createAddonStoreJson(dest) + # Add-on store does not require submitting json files. + # createAddonStoreJson(dest) return dest @@ -299,7 +300,12 @@ for file in pythonFiles: createAddonHelp("addon") for mdFile in env.Glob(os.path.join('addon', 'doc', '*', '*.md')): htmlFile = env.markdown(mdFile) - env.Depends(htmlFile, mdFile) + try: # It is possible that no moFile was set, because an add-on has no translations. + moFile + except NameError: # Runs if there is no moFile + env.Depends(htmlFile, mdFile) + else: # Runs if there is a moFile + env.Depends(htmlFile, [mdFile, moFile]) env.Depends(addon, htmlFile) # Pot target diff --git a/style.css b/style.css index 373283f..90f99d1 100644 --- a/style.css +++ b/style.css @@ -1,8 +1,6 @@ @charset "utf-8"; body { font-family : Verdana, Arial, Helvetica, Sans-serif; -color : #FFFFFF; -background-color : #000000; line-height: 1.2em; } h1, h2 {text-align: center} @@ -26,5 +24,3 @@ a { text-decoration : underline; text-decoration : none; } a:focus, a:hover {outline: solid} -:link {color: #0000FF; -background-color: #FFFFFF}