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