forked from nvdaaddons/instantTranslate
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72b48c9
commit 9070b95
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Addon-release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
cache: "pip" | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install scons markdown | ||
sudo apt update | ||
sudo apt install gettext | ||
- name: Build addon | ||
run: scons | ||
|
||
- name: Extract addon info | ||
id: extract_addon_info | ||
run: | | ||
import os | ||
import sys | ||
sys.path.append('.') | ||
from buildVars import addon_info | ||
addon_name = addon_info['addon_name'] | ||
addon_version = addon_info['addon_version'] | ||
addon_updateChannel = addon_info.get('addon_updateChannel') or 'stable' | ||
with open(os.environ['GITHUB_OUTPUT'], 'a') as f: | ||
f.write(f'addon_name={addon_name}\n') | ||
f.write(f'addon_version={addon_version}\n') | ||
f.write(f'addon_updateChannel={addon_updateChannel}\n') | ||
shell: python | ||
|
||
- name: Upload release | ||
id: release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag_name: ${{ github.ref_name }} | ||
files: "*.nvda-addon" | ||
generate_release_notes: true | ||
prerelease: false | ||
|
||
- name: Submit addon | ||
id: submit_addon | ||
uses: beqabeqa473/submitNVDAAddon@v1 | ||
with: | ||
addon_name: ${{ steps.extract_addon_info.outputs.addon_name }} | ||
addon_version: ${{ steps.extract_addon_info.outputs.addon_version }} | ||
channel: ${{ steps.extract_addon_info.outputs.addon_updateChannel }} | ||
download_url: ${{ fromJSON(steps.release.outputs.assets)[0].browser_download_url }} | ||
token: ${{ secrets.USER_TOKEN }} | ||
|
||
- name: Print_issue_number | ||
run: | | ||
echo "Issue with number ${{ steps.submit_addon.outputs.issue_number }} was created" | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Markdown==3.7 | ||
SCons==4.8.1 |