Skip to content

Commit

Permalink
Update GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nvdaes committed Apr 3, 2021
1 parent b8400ec commit fc7072f
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 32 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/automaticRelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: pre-release

on:
push:
branches:
- master

jobs:
pre-release:
name: Pre Release
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- 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()
text = re.sub("\"addon_version\" : ,", "\"addon_version\" : \"${{ github.sha }}\",", text)
f.seek(0)
f.write(text)
f.truncate()
shell: python
- name: Build
run: scons
- name: Automatic release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: Development Build
files: |
*.nvda-addon
2 changes: 2 additions & 0 deletions .github/workflows/checkForTranslations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Check for l10n updates
on:

push:
branches:
- master

schedule:
# * is a special character in YAML so you have to quote this string
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/testWithNVDA.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Build and test NVDA add-on

on:
push:
tags-ignore:
- '*'
pull_request:
branches:
- master
Expand All @@ -18,14 +15,13 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.8
- name: Install dependencies
run: |
pip install scons
pip install Markdown
pip install scons markdown
sudo apt update
sudo apt install gettext
- name: Add add-on version
Expand Down Expand Up @@ -66,10 +62,10 @@ jobs:

- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python 3.7 x86
- name: Set up Python 3.8 x86
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.8
architecture: x86
- name: Checkout NVDA
uses: actions/checkout@v2
Expand All @@ -93,13 +89,14 @@ jobs:
Expand-Archive addon.zip source\userConfig\addons\addon
- name: Start NVDA
run: |
cd source
pythonw.exe nvda.pyw -m --debug-logging
runnvda -m --debug-logging
ping 127.0.0.1 /n 20
shell: cmd
- name: Quit NVDA
run: |
pythonw.exe nvda.pyw -q
runnvda -q
ping 127.0.0.1 /n 20
shell: cmd
- name: Upload log
uses: actions/upload-artifact@v2
with:
Expand All @@ -109,7 +106,6 @@ jobs:
run: |
move *.pot tests\nvda.pot
cd tests
python checkPot.py nvda.pot
python checkPot.py nvda.pot > potResults.txt
If (Select-String -Path potResults.txt -Pattern 'Message has no translator comment' -SimpleMatch) {exit 1}
- name: Comment on PR
Expand Down
32 changes: 13 additions & 19 deletions .github/workflows/upload-on-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ on:

jobs:
buildAndUpload:
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install scons
pip install Markdown
pip install scons markdown
sudo apt update
sudo apt install gettext
- name: Add add-on version
run: |
import re
Expand All @@ -33,20 +33,14 @@ jobs:
shell: python
- name: Build add-on
run: scons
- name: Create Release
uses: actions/create-release@latest
- name: Calculate sha256
run: sha256sum *.nvda-addon >> changelog.md
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
prerelease: ${{ endsWith(github.ref, '-dev') }}
files: |
*.nvda-addon
body_path: changelog.md
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.nvda-addon'
tag: ${{ github.ref }}
overwrite: true
file_glob: true
prerelease: ${{ endsWith(github.ref, '-dev') }}

0 comments on commit fc7072f

Please sign in to comment.