From b76b36631b886cf7ee2908310a3a5fb707c49963 Mon Sep 17 00:00:00 2001 From: guredora Date: Mon, 8 Jan 2024 22:25:48 +0900 Subject: [PATCH 01/12] Update copyright year in build.py --- tools/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build.py b/tools/build.py index 0a76698..8db2c4a 100644 --- a/tools/build.py +++ b/tools/build.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- #app build tool #Copyright (C) 2019 Yukio Nozawa -#Copyright (C) 2019-2020 guredora +#Copyright (C) 2019-2024 guredora #Copyright (C) 2021 yamahubuki #Copyright (C) 2021 Hiroki Fujii From 713d842aa435078dca5452500872a36649125dd2 Mon Sep 17 00:00:00 2001 From: guredora Date: Mon, 8 Jan 2024 22:31:23 +0900 Subject: [PATCH 02/12] improving process of distinguish that The build is automated --- tools/build.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/build.py b/tools/build.py index 8db2c4a..7dd0a37 100644 --- a/tools/build.py +++ b/tools/build.py @@ -25,9 +25,9 @@ class build: def __init__(self): - # appVeyorかどうかを判別し、処理をスタート - appveyor = self.setAppVeyor() - print("Starting build for %s (appveyor mode=%s)" % (buildVars.ADDON_KEYWORD, appveyor,)) + # Github actionsなどの自動実行かどうかを判別し、処理をスタート + automated = self.setAutomated() + print("Starting build for %s(automated mode=%s)" % (buildVars.ADDON_KEYWORD, automated,)) # パッケージのパスとファイル名を決定 package_path = "output\\" @@ -71,12 +71,10 @@ def runcmd(self,cmd): proc.communicate() return proc.poll() - def setAppVeyor(self): - if len(sys.argv)>=2 and sys.argv[1]=="--appveyor": - return True - return False + def setAutomated(self): + return os.environ.get("GITHUB_ACTIONS", "false") == "true" - def creen(self,package_path): + def clean(self,package_path): if os.path.isdir(package_path): print("Clearling previous build...") shutil.rmtree("output\\") From 90d036a1709f475d0e2fabdad569b54dc4fbda53 Mon Sep 17 00:00:00 2001 From: guredora Date: Mon, 8 Jan 2024 22:32:58 +0900 Subject: [PATCH 03/12] Refactor build.py to handle different tag names --- tools/build.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/build.py b/tools/build.py index 7dd0a37..ccf3323 100644 --- a/tools/build.py +++ b/tools/build.py @@ -31,14 +31,11 @@ def __init__(self): # パッケージのパスとファイル名を決定 package_path = "output\\" - if 'APPVEYOR_REPO_TAG_NAME' in os.environ: - build_filename = os.environ['APPVEYOR_REPO_TAG_NAME'] - # タグ名とバージョンが違ったらエラー - if build_filename != buildVars.ADDON_VERSION: - print("Unexpected tag name. expecting %s." %(buildVars.ADDON_VERSION,)) - exit(-1) - else: - build_filename = 'snapshot' + build_filename = os.environ.get('TAG_NAME', 'snapshot') + # snapshotではなかった場合は、タグ名とバージョンが違ったらエラー + if (build_filename != "snapshot") and (build_filename != buildVars.ADDON_VERSION): + print("Unexpected tag name. expecting %s." %(buildVars.ADDON_VERSION,)) + exit(-1) print("Will be built as %s" % build_filename) # addonフォルダの存在を確認 From f8fcfc6506588488b8ba5bd0eee35c69b8d74977 Mon Sep 17 00:00:00 2001 From: guredora Date: Mon, 8 Jan 2024 22:34:35 +0900 Subject: [PATCH 04/12] fix missing spellings --- tools/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build.py b/tools/build.py index ccf3323..198bf10 100644 --- a/tools/build.py +++ b/tools/build.py @@ -44,7 +44,7 @@ def __init__(self): exit(-1) # 前のビルドをクリーンアップ - self.creen(package_path) + self.clean(package_path) # appveyorでのスナップショットの場合はバージョン番号を一時的に書き換え # バージョン番号をセット From dd3c38e53c6d95bf2614d06bd392f6239201bece Mon Sep 17 00:00:00 2001 From: guredora Date: Mon, 8 Jan 2024 22:36:36 +0900 Subject: [PATCH 05/12] Refactor build.py to generate snapshot version number and release date --- tools/build.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/build.py b/tools/build.py index 198bf10..219c397 100644 --- a/tools/build.py +++ b/tools/build.py @@ -79,11 +79,12 @@ def clean(self,package_path): def makeSnapshotVersionNumber(self): #日本標準時オブジェクト JST = datetime.timezone(datetime.timedelta(hours=+9)) - #Pythonは世界標準時のZに対応していないので文字列処理で乗り切り、それを日本標準時に変換 - dt = datetime.datetime.fromisoformat(os.environ["APPVEYOR_REPO_COMMIT_TIMESTAMP"][0:19]+"+00:00").astimezone(JST) - major = str(dt.year)[2:4]+str(dt.month).zfill(2) + dt = datetime.datetime.fromisoformat(os.environ["COMMIT_TIMESTAMP"]).astimezone(JST) + major = f"{dt.year % 100:02d}{dt.month:02d}" minor = str(dt.day) patch = str(int(math.floor((dt.hour*3600+dt.minute*60+dt.second)/86400*1000))) + buildVars.ADDON_VERSION = major+"."+minor+"."+patch + buildVars.ADDON_RELEASE_DATE = str(dt.date()) bumpup.bumpup(major+"."+minor+"."+patch, str(dt.date())) return major+"."+minor+"."+patch From def192e8aa752c53192d58204006ab5cd943934d Mon Sep 17 00:00:00 2001 From: guredora Date: Mon, 8 Jan 2024 22:43:41 +0900 Subject: [PATCH 06/12] refactoring build script --- tools/build.py | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/tools/build.py b/tools/build.py index 219c397..65f0e8a 100644 --- a/tools/build.py +++ b/tools/build.py @@ -46,21 +46,16 @@ def __init__(self): # 前のビルドをクリーンアップ self.clean(package_path) - # appveyorでのスナップショットの場合はバージョン番号を一時的に書き換え - # バージョン番号をセット - if build_filename == "snapshot" and appveyor: - self.version_number = self.makeSnapshotVersionNumber() - elif build_filename == "snapshot": - self.version_number = buildVars.ADDON_VERSION - else: - self.version_number = build_filename + # 自動実行でのスナップショットの場合はバージョン番号を一時的に書き換え + if build_filename == "snapshot" and automated: + self.makeSnapshotVersionNumber() # ビルド self.build(package_path, build_filename) archive_name = "%s-%s.zip" % (buildVars.ADDON_KEYWORD, build_filename,) - addon_filename = "%s-%s.nvda-addon" % (buildVars.ADDON_NAME, self.version_number) + addon_filename = "%s-%s.nvda-addon" % (buildVars.ADDON_NAME, buildVars.ADDON_VERSION,) shutil.copyfile(package_path + addon_filename, addon_filename) - self.makePackageInfo(archive_name, addon_filename, self.version_number, build_filename) + self.makePackageInfo(archive_name, addon_filename, build_filename) print("Build finished!") def runcmd(self,cmd): @@ -101,17 +96,8 @@ def build(self, package_path, build_filename): print("Compressing into package...") shutil.make_archive("%s-%s" % (buildVars.ADDON_KEYWORD, build_filename,),'zip',package_path) - def makePackageInfo(self, archive_name, addon_filename, addon_version, build_filename): - if "APPVEYOR_REPO_COMMIT_TIMESTAMP" in os.environ: - #日本標準時オブジェクト - JST = datetime.timezone(datetime.timedelta(hours=+9)) - #Pythonは世界標準時のZに対応していないので文字列処理で乗り切り、それを日本標準時に変換 - dt = datetime.datetime.fromisoformat(os.environ["APPVEYOR_REPO_COMMIT_TIMESTAMP"][0:19]+"+00:00").astimezone(JST) - dateStr = "%s-%s-%s" % (str(dt.year), str(dt.month).zfill(2), str(dt.day).zfill(2)) - else: - dateStr = "this is a local build." - - print("computing hash...") + def makePackageInfo(self, archive_name, addon_filename, build_filename): + print("Calculating hash...") with open(archive_name, mode = "rb") as f: content = f.read() package_hash = hashlib.sha1(content).hexdigest() @@ -123,9 +109,9 @@ def makePackageInfo(self, archive_name, addon_filename, addon_version, build_fil info["package_hash"] = package_hash info["patch_filename"] = addon_filename info["patch_hash"] = addon_hash - info["version"] = addon_version - info["released_date"] = dateStr - with open("DFN-%s_info.json" % (build_filename,), mode = "w") as f: + info["version"] = buildVars.ADDON_VERSION + info["released_date"] = buildVars.ADDON_RELEASE_DATE + with open("%s-%s_info.json" % (buildVars.ADDON_KEYWORD, build_filename,), mode = "w") as f: json.dump(info, f) From 923d4d73d2e479bf6283dd11f220c3f6f122bd14 Mon Sep 17 00:00:00 2001 From: guredora Date: Mon, 8 Jan 2024 22:50:46 +0900 Subject: [PATCH 07/12] add github actions workflows --- .github/workflows/pullRequest.yml | 10 ++++ .github/workflows/release.yml | 49 +++++++++++++++++ .github/workflows/snapshot.yml | 84 ++++++++++++++++++++++++++++++ .github/workflows/testAndBuild.yml | 68 ++++++++++++++++++++++++ 4 files changed, 211 insertions(+) create mode 100644 .github/workflows/pullRequest.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/snapshot.yml create mode 100644 .github/workflows/testAndBuild.yml diff --git a/.github/workflows/pullRequest.yml b/.github/workflows/pullRequest.yml new file mode 100644 index 0000000..0cb29ed --- /dev/null +++ b/.github/workflows/pullRequest.yml @@ -0,0 +1,10 @@ +name: check for pull request into master + +on: + pull_request: + branches: + - master + +jobs: + build: + uses: ./.github/workflows/testAndBuild.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9bc00d0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Build and release for official + +on: + push: + tags: + - "*.*.*" + +jobs: + build: + uses: ./.github/workflows/testAndBuild.yml + with: + official_release: true + + deploy: + needs: build + runs-on: windows-latest + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ${{ github.event.repository.name }} + path: ./ + + - name: Deploy to GitHub + uses: softprops/action-gh-release@v1 + with: + body: ${{ github.event.repository.name }} official release + draft: true + files: | + ./${{ github.event.repository.name }}-*.zip + ./${{ github.event.repository.name }}-*.json + + error_notify: + runs-on: ubuntu-latest + needs: deploy + if: ${{ failure() }} + steps: + - name: Send GitHub Action trigger data to Slack workflow + uses: slackapi/slack-github-action@v1 + with: + payload: | + { + "text": "Github actions build failed! <${{ github.server_url }}/${{ github.repository }}|${{ github.event.repository.name }}>のofficial releaseビルドが失敗しました。\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|対象のrun>お確認し、対応着手時・完了後は、本チャンネルにて経緯を報告ください。" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000..08ec6e7 --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,84 @@ +name: Build and release for snapshot + +on: + push: + branches: + - master + +jobs: + build: + uses: ./.github/workflows/testAndBuild.yml + + deploy: + needs: build + runs-on: windows-latest + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ${{ github.event.repository.name }} + path: ./ + + - name: Re-create the tag + uses: actions/github-script@v7 + with: + script: | + const { owner, repo } = context.repo + const tagName = repo + "-latestcommit" + try { + // Fetch the release by its tag + const { data: release } = await github.rest.repos.getReleaseByTag({ owner, repo, tag: tagName }) + // Delete the release if exists + await github.rest.repos.deleteRelease({ owner, repo, release_id: release.id }) + console.log("deleted release"); + } catch(err) { + if(err.status !== 404){ + throw err; + } + console.log('No release found for deletion'); + } + try { + await github.rest.git.deleteRef({owner, repo, ref: "tags/" + tagName}) + console.log("deleted tag"); + } catch(err) { + console.log('Failed to delete tag'+err.message); + } + try { + await github.rest.git.createRef({owner, repo, ref: "refs/tags/" + tagName, sha: context.sha}) + console.log("created tag"); + } catch(err) { + console.log('Failed to create tag'+err.message); + } + + - name: Deploy to GitHub + uses: softprops/action-gh-release@v1 + with: + name: Snapshot + tag_name: ${{ github.event.repository.name }}-latestcommit + body: Automatic build from master branch + files: | + ./${{ github.event.repository.name }}-*.zip + ./${{ github.event.repository.name }}-*.nvda-addon + ./${{ github.event.repository.name }}-*.json + + - name: register snapshot to actlab site + run: | + curl "https://actlab.org/api/addAlphaVersion?repo_name=${{ github.repository }}&commit_hash=${{ github.sha }}&version=${{ needs.build.outputs.build_version }}&password=${{ secrets.SCRIPT_PASSWORD }}" + + error_notify: + runs-on: ubuntu-latest + needs: deploy + if: ${{ failure() }} + steps: + - name: Send GitHub Action trigger data to Slack workflow + uses: slackapi/slack-github-action@v1 + with: + payload: | + { + "text": "Github actions build failed! <${{ github.server_url }}/${{ github.repository }}|${{ github.event.repository.name }}>のビルドが失敗しました。\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|対象のrun>お確認し、対応着手時・完了後は、本チャンネルにて経緯を報告ください。" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + diff --git a/.github/workflows/testAndBuild.yml b/.github/workflows/testAndBuild.yml new file mode 100644 index 0000000..2ee45cf --- /dev/null +++ b/.github/workflows/testAndBuild.yml @@ -0,0 +1,68 @@ +name: Test and build + +on: + workflow_call: + inputs: + official_release: + description: Whether this is an official release + default: false + type: boolean + outputs: + build_version: + description: Version of the built package + value: ${{ jobs.build.outputs.build_version }} + +jobs: + build: + runs-on: windows-latest + outputs: + build_version: ${{ steps.output_version.outputs.version }} + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + architecture: x86 + python-version: 3.8 + cache: pip + + - name: Install requirements + run: | + python -m pip install -r requirements.txt + + - name: Test + run: | + echo skiped tests + + - name: Set tag name if This is an official release + run: echo "TAG_NAME=$($env:GITHUB_REF.Replace('refs/tags/', ''))" >> $env:GITHUB_ENV + if: ${{ inputs.official_release }} + + - name: Build + run: | + python tools\build.py + env: + COMMIT_TIMESTAMP: ${{ github.event.head_commit.timestamp}} + + - name: output version + id: output_version + shell: python + run: | + import os, sys + sys.path.append(os.getcwd()) + import buildVars + with open(os.environ["GITHUB_OUTPUT"], mode = "a") as f: + f.write("version="+buildVars.ADDON_VERSION) + + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ github.event.repository.name }} + path: | + ./${{ github.event.repository.name }}-*.zip + ./${{ github.event.repository.name }}-*.nvda-addon + ./${{ github.event.repository.name }}-*.json + From c0a7002c13a9396d89b3a7d38fd6dcbae44a60f0 Mon Sep 17 00:00:00 2001 From: guredora Date: Mon, 8 Jan 2024 23:08:12 +0900 Subject: [PATCH 08/12] fixed artifact regex --- .github/workflows/release.yml | 1 + .github/workflows/snapshot.yml | 2 +- .github/workflows/testAndBuild.yml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9bc00d0..1b819d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,7 @@ jobs: draft: true files: | ./${{ github.event.repository.name }}-*.zip + ./*-*.nvda-addon ./${{ github.event.repository.name }}-*.json error_notify: diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 08ec6e7..0f293d7 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -59,7 +59,7 @@ jobs: body: Automatic build from master branch files: | ./${{ github.event.repository.name }}-*.zip - ./${{ github.event.repository.name }}-*.nvda-addon + ./*-*.nvda-addon ./${{ github.event.repository.name }}-*.json - name: register snapshot to actlab site diff --git a/.github/workflows/testAndBuild.yml b/.github/workflows/testAndBuild.yml index 2ee45cf..c04948f 100644 --- a/.github/workflows/testAndBuild.yml +++ b/.github/workflows/testAndBuild.yml @@ -63,6 +63,6 @@ jobs: name: ${{ github.event.repository.name }} path: | ./${{ github.event.repository.name }}-*.zip - ./${{ github.event.repository.name }}-*.nvda-addon + ./*-*.nvda-addon ./${{ github.event.repository.name }}-*.json From 6f26b5be7595de99c6656449c424ae724e2df7e3 Mon Sep 17 00:00:00 2001 From: guredora Date: Mon, 8 Jan 2024 23:17:57 +0900 Subject: [PATCH 09/12] deleted Unnecessary blankline --- tools/build.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/build.py b/tools/build.py index 65f0e8a..6e19ce8 100644 --- a/tools/build.py +++ b/tools/build.py @@ -48,7 +48,7 @@ def __init__(self): # 自動実行でのスナップショットの場合はバージョン番号を一時的に書き換え if build_filename == "snapshot" and automated: - self.makeSnapshotVersionNumber() + print(self.makeSnapshotVersionNumber()) # ビルド self.build(package_path, build_filename) @@ -83,7 +83,6 @@ def makeSnapshotVersionNumber(self): bumpup.bumpup(major+"."+minor+"."+patch, str(dt.date())) return major+"."+minor+"."+patch - def build(self, package_path, build_filename): print("Building...") shutil.copytree("public", package_path) @@ -91,8 +90,6 @@ def build(self, package_path, build_filename): print("build finished with status %d" % ret) if ret != 0: sys.exit(ret) - - print("Compressing into package...") shutil.make_archive("%s-%s" % (buildVars.ADDON_KEYWORD, build_filename,),'zip',package_path) From 7cf09f41ec68351d079c23d94cf9531cf03378c2 Mon Sep 17 00:00:00 2001 From: guredora Date: Mon, 8 Jan 2024 23:22:20 +0900 Subject: [PATCH 10/12] remove appveyor configration files --- appveyor-release.yml | 55 --------------------------------- appveyor.yml | 73 -------------------------------------------- 2 files changed, 128 deletions(-) delete mode 100644 appveyor-release.yml delete mode 100644 appveyor.yml diff --git a/appveyor-release.yml b/appveyor-release.yml deleted file mode 100644 index 4e372ad..0000000 --- a/appveyor-release.yml +++ /dev/null @@ -1,55 +0,0 @@ -version: development.{build}-{branch} -branches: - only: - - release - -skip_branch_with_pr: true - -environment: - matrix: - # For Python versions available on Appveyor, see - # http://www.appveyor.com/docs/installed-software#python - # The list here is complete (excluding Python 2.6, which - # isn't covered by this document) at the time of writing. - - - PYTHON: "C:\\Python37" - -install: - # We need wheel installed to build wheels - - cmd: set path=C:\\Python37;C:\\Python37\\Scripts;C:\\Python37\\lib;%path% - - cmd: python -m pip install -r requirements.txt - -build: off - -test_script: - # Put your test command here. - # If you don't need to build C extensions on 64-bit Python 3.3 or 3.4, - # you can remove "build.cmd" from the front of the command, as it's - # only needed to support those cases. - # Note that you must use the environment variable %PYTHON% to refer to - # the interpreter you're using - Appveyor does not do anything special - # to put the Python evrsion you want to use on PATH. - - "echo Skipped Tests" - -after_test: - # This step builds your wheels. - # Again, you only need build.cmd if you're building C extensions for - # 64-bit Python 3.3/3.4. And you need to use %PYTHON% to get the correct - # interpreter - - cmd: python tools\\build.py --appveyor - -artifacts: - - path: DFN-*.zip - - path: dokutor_for_nvda-*.nvda-addon - - path: DFN-*.json - -deploy: - - provider: GitHub - description: "DFN official release" - auth_token: - secure: iNSx8v6c+0TP9IyckinrvNWuX+hc7SKruOqRDl9GxdX59sZ2yqB8+UDAtqdPzKIg - artifact: /(DFN-.*\.zip)|(dokutor_for_nvda-.*\.nvda-addon)|(DFN-.*\.json)/ - draft: true - prerelease: false - on: - APPVEYOR_REPO_TAG: true diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 82177d3..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,73 +0,0 @@ -version: development.{build}-{branch} -branches: - only: - - master - -skip_branch_with_pr: true -skip_tags: true - -environment: - githubToken: - secure: iNSx8v6c+0TP9IyckinrvNWuX+hc7SKruOqRDl9GxdX59sZ2yqB8+UDAtqdPzKIg - SCRIPT_PASSWORD: - secure: 9RvVUKVQ8MsoG5LOZ86VyFQF19JXXS33tDzomLH/jZM= - matrix: - - # For Python versions available on Appveyor, see - # http://www.appveyor.com/docs/installed-software#python - # The list here is complete (excluding Python 2.6, which - # isn't covered by this document) at the time of writing. - - - PYTHON: "C:\\Python37" - -install: - # We need wheel installed to build wheels - - cmd: set path=C:\\Python37;C:\\Python37\\Scripts;C:\\Python37\\lib;%path% - - cmd: python -m pip install -r requirements.txt - -build: off - -test_script: - # Put your test command here. - # If you don't need to build C extensions on 64-bit Python 3.3 or 3.4, - # you can remove "build.cmd" from the front of the command, as it's - # only needed to support those cases. - # Note that you must use the environment variable %PYTHON% to refer to - # the interpreter you're using - Appveyor does not do anything special - # to put the Python evrsion you want to use on PATH. - - "echo Skipped Tests" - -after_test: - # This step builds your wheels. - # Again, you only need build.cmd if you're building C extensions for - # 64-bit Python 3.3/3.4. And you need to use %PYTHON% to get the correct - # interpreter - - cmd: python tools\\build.py --appveyor - - cmd: if defined APPVEYOR_PULL_REQUEST_NUMBER appveyor exit 0 - - cmd: curl "https://actlab.org/git-release.php?repo_name=%APPVEYOR_REPO_NAME%&tag_name=DFN-latestcommit&password=%SCRIPT_PASSWORD%" - - cmd: git tag -d DFN-latestcommit - - cmd: git push -d https://actlab-auto:%githubToken%@github.com/actlaboratory/DFN.git DFN-latestcommit - - cmd: git tag DFN-latestcommit - - cmd: git push https://actlab-auto:%githubToken%@github.com/actlaboratory/DFN.git DFN-latestcommit - -artifacts: - - path: DFN-*.zip - - path: dokutor_for_nvda-*.nvda-addon - - path: DFN-*.json - -deploy: - - provider: GitHub - release: DFN-latestcommit - skip_tags: true - Force update: true - description: 'automatic build from master branch' - auth_token: - secure: iNSx8v6c+0TP9IyckinrvNWuX+hc7SKruOqRDl9GxdX59sZ2yqB8+UDAtqdPzKIg - artifact: /(DFN-.*\.zip)|(dokutor_for_nvda-.*\.nvda-addon)|(DFN-.*\.json)/ # upload all NuGet packages to release assets - draft: false - prerelease: false - on: - branch: master # release from master branch only - -after_deploy: - - cmd: echo import buildVars;print("https://actlab.org/api/addAlphaVersion?repo_name=%APPVEYOR_REPO_NAME%&commit_hash=%APPVEYOR_REPO_COMMIT%&version="+buildVars.ADDON_VERSION+"&password=%SCRIPT_PASSWORD%",end="") | C:\\Python37\python.exe | xargs -n1 curl From cd5823a2140f8a8240ed014f72444dc267d03e12 Mon Sep 17 00:00:00 2001 From: Hiroki Fujii Date: Sat, 20 Jan 2024 18:58:12 +0900 Subject: [PATCH 11/12] =?UTF-8?q?=E3=82=A2=E3=83=83=E3=83=97=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/globalPlugins/dokutor_for_nvda/updater.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/addon/globalPlugins/dokutor_for_nvda/updater.py b/addon/globalPlugins/dokutor_for_nvda/updater.py index 0a2321b..29b284b 100644 --- a/addon/globalPlugins/dokutor_for_nvda/updater.py +++ b/addon/globalPlugins/dokutor_for_nvda/updater.py @@ -46,7 +46,12 @@ def __init__(self): if not updatable: log.warning("Update check not supported.") - def autoUpdateCheck(self, mode=0): + def autoUpdateCheck(self, mode=AUTO): + """ + Call this method to check for updates. mode=AUTO means automatic update check, and MANUAL means manual triggering like "check for updates" menu invocation. + When set to AUTO mode, some dialogs are not displayed (latest and error). + """ + if not updatable: return self.updater = NVDAAddOnUpdater(mode) @@ -212,7 +217,7 @@ def _download(self, url): def _downloadSuccess(self): self._stopped() from gui import addonGui - closeAfter = addonGui.AddonsDialog._instance is None or (versionInfo.version_year, versionInfo.version_major) >= (2019, 1) + addonGui.promptUserForRestart() try: try: bundle = addonHandler.AddonBundle(self.destPath.decode("mbcs")) @@ -236,8 +241,6 @@ def _downloadSuccess(self): gui.ExecAndPump(addonHandler.installAddonBundle, bundle) except BaseException: log.error("Error installing addon bundle from %s" % self.destPath, exc_info=True) - if not closeAfter: - addonGui.AddonsDialog(gui.mainFrame).refreshAddonsList() progressDialog.done() del progressDialog gui.messageBox(_("アドオンのアップデートに失敗しました。"), @@ -245,14 +248,10 @@ def _downloadSuccess(self): wx.OK | wx.ICON_ERROR) return else: - if not closeAfter: - addonGui.AddonsDialog(gui.mainFrame).refreshAddonsList(activeIndex=-1) progressDialog.done() del progressDialog finally: self.cleanup_tempfile() - if closeAfter: - wx.CallLater(1, addonGui.AddonsDialog(gui.mainFrame).Close) def cleanup_tempfile(self): if not os.path.isfile(self.destPath): From c4a1dfe4bd26e1463b11764dd7da5fc529346045 Mon Sep 17 00:00:00 2001 From: Hiroki Fujii Date: Sun, 21 Jan 2024 23:44:35 +0900 Subject: [PATCH 12/12] =?UTF-8?q?1.1.4=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildVars.py | 6 +++--- public/readme.txt | 7 +++++-- readme.md | 7 +++++-- version.json | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/buildVars.py b/buildVars.py index f01ed19..33816a2 100644 --- a/buildVars.py +++ b/buildVars.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 -*- -ADDON_VERSION = "1.1.3" -ADDON_RELEASE_DATE = "2023-03-06" +ADDON_VERSION = "1.1.4" +ADDON_RELEASE_DATE = "2024-01-21" ADDON_NAME = "dokutor_for_nvda" ADDON_KEYWORD = "DFN" @@ -41,7 +41,7 @@ def _(arg): # Minimum NVDA version supported (e.g. "2018.3.0", minor version is optional) "addon_minimumNVDAVersion": 2019.3, # Last NVDA version supported/tested (e.g. "2018.4.0", ideally more recent than minimum version) - "addon_lastTestedNVDAVersion": 2023.5, + "addon_lastTestedNVDAVersion": 2024.5, # Add-on update channel (default is None, denoting stable releases, # and for development releases, use "dev".) # Do not change unless you know what you are doing! diff --git a/public/readme.txt b/public/readme.txt index bee6fe5..463869c 100644 --- a/public/readme.txt +++ b/public/readme.txt @@ -1,6 +1,6 @@ -# 読ターFor NVDA Ver1.1.3 説明書 +# 読ターFor NVDA Ver1.1.4 説明書 -(更新: 2023-03-06) +(更新: 2024-01-21) ## 目次 @@ -154,6 +154,9 @@ ACT Laboratory(Accessible Tools Laboratory)は、プログラミングを学ぶ ## 8. 更新履歴 +* 1.1.4 (2024/01/21) + * NVDA 2024.1に対応 + * 1.1.3 (2023/03/06) * NVDA 2023.1に対応 diff --git a/readme.md b/readme.md index bee6fe5..463869c 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ -# 読ターFor NVDA Ver1.1.3 説明書 +# 読ターFor NVDA Ver1.1.4 説明書 -(更新: 2023-03-06) +(更新: 2024-01-21) ## 目次 @@ -154,6 +154,9 @@ ACT Laboratory(Accessible Tools Laboratory)は、プログラミングを学ぶ ## 8. 更新履歴 +* 1.1.4 (2024/01/21) + * NVDA 2024.1に対応 + * 1.1.3 (2023/03/06) * NVDA 2023.1に対応 diff --git a/version.json b/version.json index cca8139..5600a3d 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{"version": "1.1.3", "release_date": "2023-03-06"} \ No newline at end of file +{"version": "1.1.4", "release_date": "2024-01-21"} \ No newline at end of file