-
Notifications
You must be signed in to change notification settings - Fork 23
70 lines (63 loc) · 1.69 KB
/
upload-on-tag.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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, '-') }}