Transform NVDA addons to views #141
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/nvaccess/addon-datastore-transform/ | |
name: Transform NVDA addons to views | |
on: | |
workflow_call: | |
workflow_dispatch: | |
concurrency: | |
group: transform | |
cancel-in-progress: true | |
jobs: | |
transformAndPush: | |
runs-on: windows-latest | |
env: | |
# this is a git '--pretty=format' string | |
# %h is SHA, %n is newline, | |
# %s is commit message subject, %b is commit message body | |
COMMIT_FORMAT: "Generated from %h%n%nCommit message:%n%s%n%b" | |
strategy: | |
matrix: | |
python-version: [ 3.11 ] | |
steps: | |
- name: Checkout addon data | |
uses: actions/checkout@v4 | |
with: | |
path: data | |
ref: master | |
- name: Checkout views branch into separate folder | |
uses: actions/checkout@v4 | |
with: | |
path: views | |
ref: views | |
- name: Checkout transformation repo | |
uses: actions/checkout@v4 | |
with: | |
repository: nvaccess/addon-datastore-transform | |
path: transform | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x86 | |
- name: Install requirements and run transformation | |
run: | | |
python -m pip install --upgrade pip | |
cd transform | |
pip install -r requirements.txt | |
# empty the views git folder directory | |
Try { Remove-Item ../views/views/ -Recurse -ErrorAction stop } | |
Catch [System.Management.Automation.ItemNotFoundException] { $null } | |
python -m src.transform --loglevel DEBUG nvdaAPIVersions.json ../data/addons ../views/views | |
- name: Copy files | |
run: | | |
copy ./transform/nvdaAPIVersions.json ./views/nvdaAPIVersions.json | |
copy ./transform/docs/output.md ./views/output.md | |
copy ./data/readme.md ./views/readme.md | |
- name: Commit and push | |
run: | | |
cd data | |
git log HEAD --pretty=format:"${{ env.COMMIT_FORMAT }}" -1 > ../commitMsg.txt | |
cd ../views | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -F ../commitMsg.txt | |
git push |