Skip to content

Commit 19059e3

Browse files
author
Hiroki Fujii
committed
Merge branch 'master' into release
2 parents 8470583 + c4a1dfe commit 19059e3

12 files changed

Lines changed: 260 additions & 192 deletions

File tree

.github/workflows/pullRequest.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: check for pull request into master
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
uses: ./.github/workflows/testAndBuild.yml

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build and release for official
2+
3+
on:
4+
push:
5+
tags:
6+
- "*.*.*"
7+
8+
jobs:
9+
build:
10+
uses: ./.github/workflows/testAndBuild.yml
11+
with:
12+
official_release: true
13+
14+
deploy:
15+
needs: build
16+
runs-on: windows-latest
17+
18+
steps:
19+
- name: Download artifact
20+
uses: actions/download-artifact@v4
21+
with:
22+
name: ${{ github.event.repository.name }}
23+
path: ./
24+
25+
- name: Deploy to GitHub
26+
uses: softprops/action-gh-release@v1
27+
with:
28+
body: ${{ github.event.repository.name }} official release
29+
draft: true
30+
files: |
31+
./${{ github.event.repository.name }}-*.zip
32+
./*-*.nvda-addon
33+
./${{ github.event.repository.name }}-*.json
34+
35+
error_notify:
36+
runs-on: ubuntu-latest
37+
needs: deploy
38+
if: ${{ failure() }}
39+
steps:
40+
- name: Send GitHub Action trigger data to Slack workflow
41+
uses: slackapi/slack-github-action@v1
42+
with:
43+
payload: |
44+
{
45+
"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>お確認し、対応着手時・完了後は、本チャンネルにて経緯を報告ください。"
46+
}
47+
env:
48+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK_URL }}
49+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
50+

.github/workflows/snapshot.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build and release for snapshot
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
uses: ./.github/workflows/testAndBuild.yml
11+
12+
deploy:
13+
needs: build
14+
runs-on: windows-latest
15+
16+
steps:
17+
- name: Download artifact
18+
uses: actions/download-artifact@v4
19+
with:
20+
name: ${{ github.event.repository.name }}
21+
path: ./
22+
23+
- name: Re-create the tag
24+
uses: actions/github-script@v7
25+
with:
26+
script: |
27+
const { owner, repo } = context.repo
28+
const tagName = repo + "-latestcommit"
29+
try {
30+
// Fetch the release by its tag
31+
const { data: release } = await github.rest.repos.getReleaseByTag({ owner, repo, tag: tagName })
32+
// Delete the release if exists
33+
await github.rest.repos.deleteRelease({ owner, repo, release_id: release.id })
34+
console.log("deleted release");
35+
} catch(err) {
36+
if(err.status !== 404){
37+
throw err;
38+
}
39+
console.log('No release found for deletion');
40+
}
41+
try {
42+
await github.rest.git.deleteRef({owner, repo, ref: "tags/" + tagName})
43+
console.log("deleted tag");
44+
} catch(err) {
45+
console.log('Failed to delete tag'+err.message);
46+
}
47+
try {
48+
await github.rest.git.createRef({owner, repo, ref: "refs/tags/" + tagName, sha: context.sha})
49+
console.log("created tag");
50+
} catch(err) {
51+
console.log('Failed to create tag'+err.message);
52+
}
53+
54+
- name: Deploy to GitHub
55+
uses: softprops/action-gh-release@v1
56+
with:
57+
name: Snapshot
58+
tag_name: ${{ github.event.repository.name }}-latestcommit
59+
body: Automatic build from master branch
60+
files: |
61+
./${{ github.event.repository.name }}-*.zip
62+
./*-*.nvda-addon
63+
./${{ github.event.repository.name }}-*.json
64+
65+
- name: register snapshot to actlab site
66+
run: |
67+
curl "https://actlab.org/api/addAlphaVersion?repo_name=${{ github.repository }}&commit_hash=${{ github.sha }}&version=${{ needs.build.outputs.build_version }}&password=${{ secrets.SCRIPT_PASSWORD }}"
68+
69+
error_notify:
70+
runs-on: ubuntu-latest
71+
needs: deploy
72+
if: ${{ failure() }}
73+
steps:
74+
- name: Send GitHub Action trigger data to Slack workflow
75+
uses: slackapi/slack-github-action@v1
76+
with:
77+
payload: |
78+
{
79+
"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>お確認し、対応着手時・完了後は、本チャンネルにて経緯を報告ください。"
80+
}
81+
env:
82+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK_URL }}
83+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
84+

.github/workflows/testAndBuild.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Test and build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
official_release:
7+
description: Whether this is an official release
8+
default: false
9+
type: boolean
10+
outputs:
11+
build_version:
12+
description: Version of the built package
13+
value: ${{ jobs.build.outputs.build_version }}
14+
15+
jobs:
16+
build:
17+
runs-on: windows-latest
18+
outputs:
19+
build_version: ${{ steps.output_version.outputs.version }}
20+
21+
steps:
22+
- name: Check out repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
architecture: x86
29+
python-version: 3.8
30+
cache: pip
31+
32+
- name: Install requirements
33+
run: |
34+
python -m pip install -r requirements.txt
35+
36+
- name: Test
37+
run: |
38+
echo skiped tests
39+
40+
- name: Set tag name if This is an official release
41+
run: echo "TAG_NAME=$($env:GITHUB_REF.Replace('refs/tags/', ''))" >> $env:GITHUB_ENV
42+
if: ${{ inputs.official_release }}
43+
44+
- name: Build
45+
run: |
46+
python tools\build.py
47+
env:
48+
COMMIT_TIMESTAMP: ${{ github.event.head_commit.timestamp}}
49+
50+
- name: output version
51+
id: output_version
52+
shell: python
53+
run: |
54+
import os, sys
55+
sys.path.append(os.getcwd())
56+
import buildVars
57+
with open(os.environ["GITHUB_OUTPUT"], mode = "a") as f:
58+
f.write("version="+buildVars.ADDON_VERSION)
59+
60+
- name: Archive production artifacts
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: ${{ github.event.repository.name }}
64+
path: |
65+
./${{ github.event.repository.name }}-*.zip
66+
./*-*.nvda-addon
67+
./${{ github.event.repository.name }}-*.json
68+

addon/globalPlugins/dokutor_for_nvda/updater.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ def __init__(self):
4646
if not updatable:
4747
log.warning("Update check not supported.")
4848

49-
def autoUpdateCheck(self, mode=0):
49+
def autoUpdateCheck(self, mode=AUTO):
50+
"""
51+
Call this method to check for updates. mode=AUTO means automatic update check, and MANUAL means manual triggering like "check for updates" menu invocation.
52+
When set to AUTO mode, some dialogs are not displayed (latest and error).
53+
"""
54+
5055
if not updatable:
5156
return
5257
self.updater = NVDAAddOnUpdater(mode)
@@ -212,7 +217,7 @@ def _download(self, url):
212217
def _downloadSuccess(self):
213218
self._stopped()
214219
from gui import addonGui
215-
closeAfter = addonGui.AddonsDialog._instance is None or (versionInfo.version_year, versionInfo.version_major) >= (2019, 1)
220+
addonGui.promptUserForRestart()
216221
try:
217222
try:
218223
bundle = addonHandler.AddonBundle(self.destPath.decode("mbcs"))
@@ -236,23 +241,17 @@ def _downloadSuccess(self):
236241
gui.ExecAndPump(addonHandler.installAddonBundle, bundle)
237242
except BaseException:
238243
log.error("Error installing addon bundle from %s" % self.destPath, exc_info=True)
239-
if not closeAfter:
240-
addonGui.AddonsDialog(gui.mainFrame).refreshAddonsList()
241244
progressDialog.done()
242245
del progressDialog
243246
gui.messageBox(_("アドオンのアップデートに失敗しました。"),
244247
_("エラー"),
245248
wx.OK | wx.ICON_ERROR)
246249
return
247250
else:
248-
if not closeAfter:
249-
addonGui.AddonsDialog(gui.mainFrame).refreshAddonsList(activeIndex=-1)
250251
progressDialog.done()
251252
del progressDialog
252253
finally:
253254
self.cleanup_tempfile()
254-
if closeAfter:
255-
wx.CallLater(1, addonGui.AddonsDialog(gui.mainFrame).Close)
256255

257256
def cleanup_tempfile(self):
258257
if not os.path.isfile(self.destPath):

appveyor-release.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

appveyor.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)