Skip to content

Commit

Permalink
Update add-on template
Browse files Browse the repository at this point in the history
  • Loading branch information
AAClause committed Jan 23, 2024
1 parent 89a04e3 commit fc34323
Show file tree
Hide file tree
Showing 13 changed files with 607 additions and 873 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build_addon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: build addon

on:
push:
tags: ["*"]
# To build on main/master branch, uncomment the following line:
# branches: [ main , master ]

pull_request:
branches: [ main, master ]

workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

steps:
- 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: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y gettext
- name: Code checks
run: export SKIP=no-commit-to-branch; pre-commit run --all

- name: building addon
run: scons

- uses: actions/upload-artifact@v3
with:
name: packaged_addon
path: ./*.nvda-addon

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
fail_on_unmatched_files: true
prerelease: ${{ contains(github.ref, '-') }}
13 changes: 5 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
/.project
/.pydevproject
/.settings/
.vscode/
/addon/doc/style.css
/addon/locale/*/manifest.ini
/addon/manifest.ini
addon/doc/*.css
addon/doc/en/
*_docHandler.py
*.html
manifest.ini
*.mo
*.pot
*.py[co]
/*.nvda-addon
*.nvda-addon
.sconsign.dblite
/[0-9]*.[0-9]*.[0-9]*.json
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-yaml
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-python.python",
"ms-python.vscode-pylance",
"redhat.vscode-yaml",
"ms-python.flake8"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
20 changes: 20 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"editor.accessibilitySupport": "on",
"flake8.args": [
"--config=flake8.ini"
],
"flake8.importStrategy": "fromEnvironment",
"python.autoComplete.extraPaths": [
"../nvda/source",
"../nvda/miscDeps/python"
],
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"editor.insertSpaces": false,
"python.analysis.stubPath": "${workspaceFolder}/.vscode/typings",
"python.analysis.extraPaths": [
"../nvda/source",
"../nvda/miscDeps/python"
],
"python.defaultInterpreterPath": "${workspaceFolder}/../nvda/.venv/scripts/python.exe"
}
6 changes: 6 additions & 0 deletions .vscode/typings/__builtins__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def _(msg: str) -> str:
...


def pgettext(context: str, message: str) -> str:
...
Loading

0 comments on commit fc34323

Please sign in to comment.