Skip to content

Commit a624975

Browse files
committed
Finetune the cmd/update-release.py script so the Python venv is in its own folder
1 parent 6446eef commit a624975

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.DS_Store
2-
venv
2+
cmd/update-release/venv*
33
*.xcodeproj/xcuserdata
44
*.xcodeproj/project.xcworkspace

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ release:
1414
release-dmg:
1515
xcodebuild -workspace "syncthing.xcworkspace" -derivedDataPath $(PWD) -configuration Release -scheme Pods-syncthing
1616
xcodebuild -workspace "syncthing.xcworkspace" -derivedDataPath $(PWD) -configuration Release -scheme syncthing-dmg
17-
release-update:
18-
source ./venv/bin/activate && ./cmd/update-release.py
17+
update-release:
18+
$(MAKE) -C cmd/update-release run
1919
clean:
2020
rm -Rf Build Index Logs ModuleCache.noindex info.plist

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ See also the Apple Developer documentation at <https://developer.apple.com/docum
263263

264264
## Release management
265265

266-
Activate the Python virtual environment with `semver` module installed. E.g `source venv/bin/activate`.
266+
Run `make update-release` from the toplevel Makefile to bundle latest Syncthing from GitHub.
267267

268268
To update the bundled syncthing the `make release-update` must be run from the main folder which does
269269
basicly these steps automatically:

cmd/update-release/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
VENV_PATH=$(shell python3 -c "import sys; print(f'venv{sys.version_info.major}{sys.version_info.minor}')")
2+
3+
# Define the path to the Python executable within the virtual environment
4+
PYTHON_EXEC = $(VENV_PATH)/bin/python
5+
6+
# Define the Python script to run
7+
SCRIPT_NAME = update-release.py
8+
9+
run: $(VENV_PATH)
10+
$(PYTHON_EXEC) $(SCRIPT_NAME)
11+
12+
clean:
13+
rm -rf $(VENV_PATH)
14+
15+
$(VENV_PATH):
16+
python3 -m venv create $(VENV_PATH)
17+
$(PYTHON_EXEC) -m pip install --upgrade pip
18+
$(PYTHON_EXEC) -m pip install semver
19+
20+
.PHONY: run clean
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# 4. Update the syncthing/Scripts/syncthing-resource.sh
88
#
99
###
10+
import os
1011
import sys
1112
import json
1213
import semver
@@ -16,9 +17,9 @@
1617

1718
distVersion = 1
1819
latest_url = "https://api.github.com/repos/syncthing/syncthing/releases/latest"
19-
infoPlist = 'syncthing/Info.plist'
20-
infoPlistTmpl = 'syncthing/Info.plist.tmpl'
21-
syncthingResourceScript = "syncthing/Scripts/syncthing-resource.sh"
20+
infoPlist = '../../syncthing/Info.plist'
21+
infoPlistTmpl = '../../syncthing/Info.plist.tmpl'
22+
syncthingResourceScript = "../../syncthing/Scripts/syncthing-resource.sh"
2223

2324
###
2425
# Download latest tag from github

0 commit comments

Comments
 (0)