Compare commits

..

No commits in common. "dev" and "v1.1.0" have entirely different histories.
dev ... v1.1.0

4 changed files with 45 additions and 47 deletions

View File

@ -1,9 +1,10 @@
name: Build Addon name: build addon
on: on:
push: push:
tags: tags: ["*"]
- 'v*.*.*' # To build on main/master branch, uncomment the following line:
# branches: [ main , master ]
pull_request: pull_request:
branches: [ main, master ] branches: [ main, master ]
@ -12,27 +13,28 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
os: [ubuntu-latest]
steps: steps:
- name: Checkout code - uses: actions/checkout@v4
uses: actions/checkout@v4
- name: Set up PDM - name: Set up PDM
uses: pdm-project/setup-pdm@v4 uses: pdm-project/setup-pdm@v4
with: with:
python-version: '3.11' python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies
run: | run: |
pdm sync -d -G build pdm sync -d -G build
- name: Build addon - name: building addon
run: pdm run scons run: pdm run scons
- name: Upload build artifacts - uses: actions/upload-artifact@v3
if: success()
uses: actions/upload-artifact@v4
with: with:
name: packaged_addon name: packaged_addon
path: ./*.nvda-addon path: ./*.nvda-addon
@ -40,20 +42,17 @@ jobs:
upload_release: upload_release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }} if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: build needs: ["build"]
steps: steps:
- name: Download releases files - uses: actions/checkout@v3
- name: download releases files
uses: actions/download-artifact@v4.1.7 uses: actions/download-artifact@v4.1.7
with:
name: packaged_addon
- name: Display structure of downloaded files - name: Display structure of downloaded files
run: tree run: ls -R
- name: Release - name: Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
files: ./*.nvda-addon files: packaged_addon/*.nvda-addon
fail_on_unmatched_files: true fail_on_unmatched_files: true
prerelease: ${{ contains(github.ref, '-') }} prerelease: ${{ contains(github.ref, '-') }}

View File

@ -1,26 +0,0 @@
version: '3'
vars:
SHELL: pwsh
tasks:
default:
desc: Build the addon
cmds:
- task: build
copy:
desc: Copy sources files to scratchpad directory
platforms: [windows]
vars:
SOURCE: addon\globalPlugins\voicemeeter
DEST: ${env:appdata}\nvda\scratchpad\globalPlugins\voicemeeter\
cmds:
- "{{.SHELL}} -Command 'robocopy {{.SOURCE}} {{.DEST}} /NDL'"
ignore_error: true
build:
desc: Build the addon
platforms: [windows]
cmds:
- '{{.SHELL}} -Command "pdm run scons"'

25
build.ps1 Normal file
View File

@ -0,0 +1,25 @@
param (
[switch]$build
)
function Copy-FilesToScratchpad {
$source = Join-Path $PSScriptRoot "addon" "globalPlugins" "voicemeeter"
$target = Join-Path $env:appdata "nvda" "scratchpad" "globalPlugins" "voicemeeter"
Robocopy $source $target | Out-Null
}
function Build-Addon {
"Building add-on" | Write-Host
scons
}
function Main {
"Copying updated files to Scratchpad" | Write-Host
Copy-FilesToScratchpad
if ($build) {
Build-Addon
}
}
if ($MyInvocation.InvocationName -ne '.') { Main }

View File

@ -20,8 +20,8 @@ build = [
distribution = false distribution = false
[tool.pdm.scripts] [tool.pdm.scripts]
copy = "task copy" copy = "pwsh build.ps1"
release = "task build" build = "pwsh build.ps1 -build"
[tool.ruff] [tool.ruff]
exclude = [ exclude = [