Create copies of win32 functions to not change global state and to fi… #9
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
name: build-and-release-addon | |
on: | |
push: | |
tags: ["*"] | |
workflow_dispatch: | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install --upgrade scons markdown | |
sudo apt-get update -y | |
sudo apt-get install -y gettext | |
- name: Extract Changelog | |
run: | | |
import re | |
with open("changelog.md", "r", encoding="UTF-8") as f: | |
text = f.read() | |
matches = [] | |
for match in re.finditer("^## v\d\.\d\.\d", text, re.MULTILINE | re.IGNORECASE): | |
if match: | |
matches.append(match) | |
if len(matches) == 2: | |
break | |
string = text[matches[0].start():matches[1].start() - 1].strip() + "\n" | |
with open("release_description.md", "w", encoding="UTF-8") as f: | |
f.write(string) | |
shell: python | |
- name: Build add-on | |
run: scons | |
- name: Create release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ./*.nvda-addon | |
body_path: release_description.md | |
prerelease: contains(github.ref, '-pre') | |
fail_on_unmatched_files: true |