2025-02-18 11:24:02 +00:00
|
|
|
name: Build Addon
|
2023-09-23 22:55:58 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2025-02-18 11:25:00 +00:00
|
|
|
tags:
|
|
|
|
- 'v*.*.*'
|
2023-09-23 22:55:58 +01:00
|
|
|
|
|
|
|
pull_request:
|
|
|
|
branches: [ main, master ]
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2025-02-18 11:24:02 +00:00
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2025-01-24 00:49:55 +00:00
|
|
|
- name: Set up PDM
|
|
|
|
uses: pdm-project/setup-pdm@v4
|
|
|
|
with:
|
2025-02-18 11:24:02 +00:00
|
|
|
python-version: '3.11'
|
2025-01-24 00:49:55 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pdm sync -d -G build
|
|
|
|
|
2025-02-18 11:24:02 +00:00
|
|
|
- name: Build addon
|
2025-01-24 00:49:55 +00:00
|
|
|
run: pdm run scons
|
|
|
|
|
2025-02-18 11:24:02 +00:00
|
|
|
- name: Upload build artifacts
|
|
|
|
if: success()
|
|
|
|
uses: actions/upload-artifact@v4
|
2025-01-24 00:49:55 +00:00
|
|
|
with:
|
|
|
|
name: packaged_addon
|
|
|
|
path: ./*.nvda-addon
|
2023-09-23 22:55:58 +01:00
|
|
|
|
|
|
|
upload_release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
2025-02-18 11:24:02 +00:00
|
|
|
needs: build
|
|
|
|
|
2023-09-23 22:55:58 +01:00
|
|
|
steps:
|
2025-02-18 11:24:02 +00:00
|
|
|
- name: Download releases files
|
2024-09-04 09:19:42 +01:00
|
|
|
uses: actions/download-artifact@v4.1.7
|
2025-01-24 01:31:27 +00:00
|
|
|
with:
|
|
|
|
name: packaged_addon
|
2025-02-18 11:24:02 +00:00
|
|
|
|
2023-09-23 22:55:58 +01:00
|
|
|
- name: Display structure of downloaded files
|
2025-02-18 11:24:02 +00:00
|
|
|
run: tree
|
2023-09-23 22:55:58 +01:00
|
|
|
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2025-01-24 01:41:40 +00:00
|
|
|
files: ./*.nvda-addon
|
2023-09-23 22:55:58 +01:00
|
|
|
fail_on_unmatched_files: true
|
|
|
|
prerelease: ${{ contains(github.ref, '-') }}
|