-
Notifications
You must be signed in to change notification settings - Fork 7
150 lines (145 loc) · 4.67 KB
/
automaticRelease.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: automatic-release
on:
push:
branches:
- main
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 * * 6'
jobs:
l10n:
name: l10n
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Push l10n updates
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
git remote add l10n https://github.com/nvdaaddons/MathCAT
git fetch l10n
git reset l10n/stable addon/doc addon/locale
git commit -m "Update translations"
git pull
git push
exit(0) # exiting with '1' for some reason, so force proper exit
rust-64:
name: Build 64 bit version and test it (don't both repeating for 32 bit version)
runs-on: windows-latest # needs to run on windows because of bzip2
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: 'x64'
- name: Build Rust Library
run: |
rustup target add x86_64-pc-windows-msvc
cargo build --target x86_64-pc-windows-msvc --release
- name: Setup Example dir
run: |
cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd
cp -r addon/globalPlugins/MathCAT/Rules Example
- name: create rules.zip
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: '../Rules.zip'
directory: 'Example'
path: 'Rules'
# build the test after zipping up "Rules" because the test will unzip the files needed for the test
#
# - name: test build
# run: |
# cd Example
# python test.py
- name rename pyd file
run: mv Example/libmathcat_py.pyd Example/libmathcat_py-64-3.11.pyd
- name: Upload 64 bit pyd file
uses: actions/upload-artifact@v4
with:
name: libmathcat_py-64-3.11.pyd
path: Example/libmathcat_py-64-3.11.pyd
compression-level: 0
retention-days: 1
- name: Upload Rules.zip
uses: actions/upload-artifact@v4
with:
name: Rules.zip
path: Rules.zip
compression-level: 0
retention-days: 1
rust-32:
name: build 32-bit pyd file and addon
needs: l10n
runs-on: windows-latest # needs to run on windows because no 32-bit python on linux
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: 'x86'
- name: Build Rust Library
run: cargo build --target i686-pc-windows-msvc --release
- name: Set up addons dir
run: |
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py.pyd
sed 's/^import wx\.xrc/# import wx.xrc/' --in-place "addon/globalPlugins/MathCAT/MathCATgui.py" # fix wx file
- name: Upload addons dir to use with scons
uses: actions/upload-artifact@v4
with:
name: MathCAT_addons
path: addon/globalPlugins
retention-days: 1
pre-release:
name: Pre Release
continue-on-error: false
needs: [rust-64, rust-32]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Download MathCAT addons dir
uses: actions/download-artifact@v4
with:
name: libmathcat_py-64-3.11.pyd
- shell: bash
run: |
cp -r MathCAT addon/globalPlugins
- name: Install scons dependencies
run: |
pip install scons markdown
sudo apt update
sudo apt install gettext
- name: Run scons to build addon
run: |
scons
- name: copy standalone library so it has a meaningful name
run: |
cp addon/globalPlugins/MathCAT/libmathcat_py.pyd libmathcat_py-32-3.11.pyd
- name: Download 64 bit build
uses: actions/download-artifact@v4
with:
name: MathCAT_addons
- 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
libmathcat_py-32-3.11.pyd
libmathcat_py-64-3.11.pyd
Rules.zip