Skip to content

Commit 56308df

Browse files
committed
update build to use current MathCAT build on github and change the title to include that
1 parent 6d0d10d commit 56308df

2 files changed

Lines changed: 364 additions & 145 deletions

File tree

.github/workflows/automaticRelease.yaml

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ jobs:
3232
steps:
3333
- name: Checkout code
3434
uses: actions/checkout@v3
35+
- name: Use MathCAT from GitHub latest tag
36+
shell: bash
37+
run: |
38+
VERSION=$(curl -fsSL https://raw.githubusercontent.com/NSoiffer/MathCAT/latest/Cargo.toml \
39+
| sed -n 's/^version = "\(.*\)"/\1/p' | head -n1)
40+
if [ -z "$VERSION" ]; then
41+
echo "Failed to read MathCAT version from latest tag" >&2
42+
exit 1
43+
fi
44+
echo "Syncing package version to MathCAT $VERSION"
45+
sed -i.bak \
46+
-e "s/^version = \".*\"/version = \"$VERSION\"/" \
47+
-e 's|mathcat = { path = "../MathCAT/" }|mathcat = { git = "https://github.com/NSoiffer/MathCAT", tag = "latest" }|' \
48+
-e 's|mathcat = { path = "../MathCAT/", features = \["include-zip"\] }|mathcat = { git = "https://github.com/NSoiffer/MathCAT", tag = "latest", features = ["include-zip"] }|' \
49+
Cargo.toml
50+
rm -f Cargo.toml.bak
3551
- name: Build Rust Library
3652
run: |
3753
cargo build --target x86_64-unknown-linux-gnu # doesn't need a release build since all that we want is the Rules dir
@@ -56,6 +72,22 @@ jobs:
5672
steps:
5773
- name: Checkout code
5874
uses: actions/checkout@v3
75+
- name: Use MathCAT from GitHub latest tag
76+
shell: bash
77+
run: |
78+
VERSION=$(curl -fsSL https://raw.githubusercontent.com/NSoiffer/MathCAT/latest/Cargo.toml \
79+
| sed -n 's/^version = "\(.*\)"/\1/p' | head -n1)
80+
if [ -z "$VERSION" ]; then
81+
echo "Failed to read MathCAT version from latest tag" >&2
82+
exit 1
83+
fi
84+
echo "Syncing package version to MathCAT $VERSION"
85+
sed -i.bak \
86+
-e "s/^version = \".*\"/version = \"$VERSION\"/" \
87+
-e 's|mathcat = { path = "../MathCAT/" }|mathcat = { git = "https://github.com/NSoiffer/MathCAT", tag = "latest" }|' \
88+
-e 's|mathcat = { path = "../MathCAT/", features = \["include-zip"\] }|mathcat = { git = "https://github.com/NSoiffer/MathCAT", tag = "latest", features = ["include-zip"] }|' \
89+
Cargo.toml
90+
rm -f Cargo.toml.bak
5991
- name: Set up Python
6092
uses: actions/setup-python@v5
6193
with:
@@ -93,6 +125,22 @@ jobs:
93125
steps:
94126
- name: Checkout code
95127
uses: actions/checkout@v3
128+
- name: Use MathCAT from GitHub latest tag
129+
shell: bash
130+
run: |
131+
VERSION=$(curl -fsSL https://raw.githubusercontent.com/NSoiffer/MathCAT/latest/Cargo.toml \
132+
| sed -n 's/^version = "\(.*\)"/\1/p' | head -n1)
133+
if [ -z "$VERSION" ]; then
134+
echo "Failed to read MathCAT version from latest tag" >&2
135+
exit 1
136+
fi
137+
echo "Syncing package version to MathCAT $VERSION"
138+
sed -i.bak \
139+
-e "s/^version = \".*\"/version = \"$VERSION\"/" \
140+
-e 's|mathcat = { path = "../MathCAT/" }|mathcat = { git = "https://github.com/NSoiffer/MathCAT", tag = "latest" }|' \
141+
-e 's|mathcat = { path = "../MathCAT/", features = \["include-zip"\] }|mathcat = { git = "https://github.com/NSoiffer/MathCAT", tag = "latest", features = ["include-zip"] }|' \
142+
Cargo.toml
143+
rm -f Cargo.toml.bak
96144
- name: Set up Python
97145
uses: actions/setup-python@v5
98146
with:
@@ -130,6 +178,22 @@ jobs:
130178
steps:
131179
- name: Checkout code
132180
uses: actions/checkout@v3
181+
- name: Use MathCAT from GitHub latest tag
182+
shell: bash
183+
run: |
184+
VERSION=$(curl -fsSL https://raw.githubusercontent.com/NSoiffer/MathCAT/latest/Cargo.toml \
185+
| sed -n 's/^version = "\(.*\)"/\1/p' | head -n1)
186+
if [ -z "$VERSION" ]; then
187+
echo "Failed to read MathCAT version from latest tag" >&2
188+
exit 1
189+
fi
190+
echo "Syncing package version to MathCAT $VERSION"
191+
sed -i.bak \
192+
-e "s/^version = \".*\"/version = \"$VERSION\"/" \
193+
-e 's|mathcat = { path = "../MathCAT/" }|mathcat = { git = "https://github.com/NSoiffer/MathCAT", tag = "latest" }|' \
194+
-e 's|mathcat = { path = "../MathCAT/", features = \["include-zip"\] }|mathcat = { git = "https://github.com/NSoiffer/MathCAT", tag = "latest", features = ["include-zip"] }|' \
195+
Cargo.toml
196+
rm -f Cargo.toml.bak
133197
- name: Set up Python
134198
uses: actions/setup-python@v5
135199
with:
@@ -199,6 +263,17 @@ jobs:
199263
pip install scons markdown
200264
sudo apt update
201265
sudo apt install gettext
266+
- name: Sync addon version from MathCAT latest
267+
shell: bash
268+
run: |
269+
VERSION=$(curl -fsSL https://raw.githubusercontent.com/NSoiffer/MathCAT/latest/Cargo.toml \
270+
| sed -n 's/^version = "\(.*\)"/\1/p' | head -n1)
271+
if [ -z "$VERSION" ]; then
272+
echo "Failed to read MathCAT version from latest tag" >&2
273+
exit 1
274+
fi
275+
echo "Syncing addon_version to MathCAT $VERSION"
276+
sed -i "s/\"addon_version\": \"[^\"]*\"/\"addon_version\": \"$VERSION\"/" buildVars.py
202277
- name: Run scons to build .addon file
203278
run: |
204279
scons
@@ -207,6 +282,7 @@ jobs:
207282
for f in *.nvda-addon; do
208283
mv "$f" "${f%.nvda-addon}-64.nvda-addon"
209284
done
285+
ls -l *.nvda-addon
210286
- name: Upload the addon
211287
uses: actions/upload-artifact@v4
212288
with:
@@ -252,6 +328,17 @@ jobs:
252328
pip install scons markdown
253329
sudo apt update
254330
sudo apt install gettext
331+
- name: Sync addon version from MathCAT latest
332+
shell: bash
333+
run: |
334+
VERSION=$(curl -fsSL https://raw.githubusercontent.com/NSoiffer/MathCAT/latest/Cargo.toml \
335+
| sed -n 's/^version = "\(.*\)"/\1/p' | head -n1)
336+
if [ -z "$VERSION" ]; then
337+
echo "Failed to read MathCAT version from latest tag" >&2
338+
exit 1
339+
fi
340+
echo "Syncing addon_version to MathCAT $VERSION"
341+
sed -i "s/\"addon_version\": \"[^\"]*\"/\"addon_version\": \"$VERSION\"/" buildVars.py
255342
- name: Update NVDA Version Constraints
256343
run: |
257344
# Adjust the version numbers for the old 32 bit NVDA version
@@ -268,6 +355,7 @@ jobs:
268355
for f in *.nvda-addon; do
269356
mv "$f" "${f%.nvda-addon}-32.nvda-addon"
270357
done
358+
ls -l *.nvda-addon
271359
- name: Upload the addon
272360
uses: actions/upload-artifact@v4
273361
with:
@@ -314,14 +402,25 @@ jobs:
314402
run: |
315403
mv addon-64/*.nvda-addon . 2>/dev/null || true
316404
mv addon-32/*.nvda-addon . 2>/dev/null || true
405+
- name: Get MathCAT version for release title
406+
id: mathcat-version
407+
shell: bash
408+
run: |
409+
VERSION=$(curl -fsSL https://raw.githubusercontent.com/NSoiffer/MathCAT/latest/Cargo.toml \
410+
| sed -n 's/^version = "\(.*\)"/\1/p' | head -n1)
411+
if [ -z "$VERSION" ]; then
412+
echo "Failed to read MathCAT version from latest tag" >&2
413+
exit 1
414+
fi
415+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
317416
# put the files into the release
318417
- name: Automatic release
319418
uses: marvinpinto/action-automatic-releases@latest
320419
with:
321420
repo_token: ${{ secrets.GITHUB_TOKEN }}
322421
automatic_release_tag: latest
323422
prerelease: true
324-
title: Development Build
423+
title: Development Build (using version ${{ steps.mathcat-version.outputs.version }})
325424
files: |
326425
*.nvda-addon
327426
libmathcat_py-32-3.11-win.zip

0 commit comments

Comments
 (0)