Skip to content

Commit a54a596

Browse files
committed
Complete configuration for auto updater.
- Generate packages_windows.lua and packages_mac.lua as part of release builds and include them in the release artifacts. For now, since we are only distributing plugins inside the distribution, we can use a simple template and a sed-based find/replace to generate these files. dist/gen_packages.lua works for this purpose as well, but requires Lua to be installed in the CI environment, which is non-trivial. We can always revisit if we decide to distribute plugin packages separately. - Point the auto-updater to a known location on GitHub pages to search for new packages. With this along with mrichards42#102 and mrichards42#103 (along with mrichards42#106 for Windows), the full distribution workflow is functional on Windows/Mac. Pushing a new build consists of the following steps: 1) Create a GitHub release. Set the tag to a valid release number, e.g. "0.7.0". 2) Wait for CI builds to complete successfully on AppVeyor (Windows) and Travis CI (Mac). 3) Validate that the builds are functioning as expected. 4) Download packages_windows.lua and packages_mac.lua from the builds to docs/, commit, and push (to master). This will cause the new build to go "live" and start showing up for auto updates. See mrichards42#40
1 parent 29b26ce commit a54a596

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

Diff for: .travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ before_deploy:
3434
- pushd bin/$CONFIGURATION
3535
- zip -r XWord-macOS.zip XWord.app/ -x *.fbp
3636
- popd
37+
- sed -e "s/{VERSION}/${XWORD_VERSION}/" -e "s/{OS_FILE}/XWord-macOS.zip/" dist/packages_template.lua > dist/packages_mac.lua
3738

3839
# Deploy tagged release builds to GitHub Releases
3940
deploy:

Diff for: appveyor.yml

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ build_script:
3333
# For release builds, also build docs and run dist steps.
3434
- IF %CONFIGURATION%==Release pushd doc & make_help.cmd & popd
3535
- IF %CONFIGURATION%==Release pushd dist & "%ProgramFiles(x86)%\NSIS\makensis.exe" /V4 XWord.nsi & popd
36+
- IF %CONFIGURATION%==Release sed -e "s/{VERSION}/%XWORD_VERSION%/" -e "s/{OS_FILE}/XWord-Windows.exe/" dist/packages_template.lua > dist/packages_windows.lua
3637

3738
# Zip the full build folder and make it available as an artifact.
3839
after_build:
@@ -45,6 +46,9 @@ artifacts:
4546
- path: dist\XWord-Windows.exe
4647
name: XWord-Windows.exe
4748

49+
- path: dist\packages_windows.lua
50+
name: packages_windows.lua
51+
4852
# Deploy tagged release builds to GitHub Releases
4953
deploy:
5054
provider: GitHub

Diff for: dist/packages_template.lua

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
return {
2+
xword = {
3+
download = "https://github.com/mrichards42/xword/releases/download/{VERSION}/{OS_FILE}",
4+
name = "XWord",
5+
version = "{VERSION}",
6+
},
7+
}

Diff for: scripts/xword/pkgmgr/updater/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if not task.is_main then return P end
2626

2727
-- Check for an update. Callback is called after the task executes
2828
local osname = wx.__WXMSW__ and 'windows' or wx.__WXMAC__ and 'mac' or 'linux'
29-
P.packages_url = "http://sourceforge.net/projects/wx-xword/files/scripts/packages_"..osname..".lua"
29+
P.packages_url = "https://mrichards42.github.io/xword/packages_"..osname..".lua"
3030

3131
function P.CheckForUpdates(callback)
3232
-- Make sure we have a directory for the updates file

0 commit comments

Comments
 (0)