Created
March 10, 2020 12:26
-
-
Save nvdaes/05451e4e6065bf67a2f121b3028de5ec to your computer and use it in GitHub Desktop.
GitHub workflow to manage NVDA add-ons with GitHub Actions
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 NVDA add-on | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install scons | |
pip install Markdown | |
pip install flake8 | |
pip install flake8-tabs | |
- name: Lint with flake8 | |
run: | |
flake8 --exit-zero addon | |
# stop the build if there are Python syntax errors or undefined names | |
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Build add-on | |
run: scons | |
- name: Create Release | |
if: contains(github.ref, '/tags/') | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
prerelease: ${{ endsWith(github.ref, '-dev') }} | |
- name: Upload binaries to release | |
if: contains(github.ref, '/tags/') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: '*.nvda-addon' | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment