version 23.12.1 #23
Workflow file for this run
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
permissions: | |
contents: write | |
name: Upload on new tags | |
on: | |
push: | |
tags: | |
['*'] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
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: | | |
pip install scons markdown | |
sudo apt update | |
sudo apt install gettext | |
- name: Add add-on version | |
run: | | |
import re | |
with open("buildVars.py", 'r+', encoding='utf-8') as f: | |
text = f.read() | |
version = "${{ github.ref }}".split("/")[-1] | |
text = re.sub('"addon_version" *:.*,', '"addon_version" : "%s",' % version, text) | |
f.seek(0) | |
f.write(text) | |
f.truncate() | |
shell: python | |
- name: Build add-on | |
run: scons | |
- name: Calculate sha256 | |
run: sha256sum *.nvda-addon >> changelog.md | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: packaged_addon | |
path: | | |
./*.nvda-addon | |
./*.json | |
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, '-') }} |