1
0
mirror of synced 2026-01-26 20:31:53 +00:00

Windows installer and medley script for running Medley in Docker on Windows (#1077)

* Update docker file build to use new deb linux installers;  move Dockefile to .github/workflows since its really only useable from the buildDocker.yml workflow

* Fix typo in dockerfile location

* remove extraneous " in >>GITHUB_ENV statements

* Fix handling of TARGETPLATFORM in Dockerfile

* Trying with just one platform

* Fix issues with missing man-db in docker build workflow; added man-db to depends in deb builds for linux

* Sicthed docker from tightvnc to tigervnc to match oio.  This getting the apt package name right.

* Going back to single platform to debug this thing

* Trying with just arm64

* Removing arm/v7 from docker images.  Takes too long to build and just wastes our github actions minutes.  This is assuming its a never used feature since docker is not big on raspberry pis and their ilk.

* Fix typo in control-linux; update build_deb so that files in /usr/local installed by deb are owned by root; add ubuntu user and nano in docker file for dbebugging;  when in draft only create for x86_64 platform

* Fix typo in buildDocker.yml

* Add sudo to docker image; in docker image ensure that all /usr/local/interlisp files are owned by root

* Add securityTypes none to docker entrypoint

* Updated docker base to Ubuntu 22.10 to get fixed xrdp; add xrdp to the docker image; updated user permission in docker image;

* In Dockerfile make xrdp install noninteractive

* Update medley.sh scripts to handle docker case

* Fix a couple of typos

* BuildDcoker: added pulling latest draft release (if any) when this is a draft docker build; removed checkout of medley code cause its not used

* BuildDocker: added medley checkout backin - turns pout its needed by a bunch of actions even though I dont really think they use it

* BuildDocker: moved download assets to use gh instaed of a marketplace action becauase that action could not handle draft releases.

* Tweaking medley.sh and associated tweaks to work Windows via wsl medley and docker

* adding first pass at powershell script for windows docker and wsl

* Tuning how Xvnc, medley, and vncviewer handle the various ways of exiting - eg logout vs closing viewer window.

* Tuning vncviewer launch to make sure that tty works as expected when medley.sh runs in background

* Minor typo fixes and added extra check to use of /run/shm in medley_vnc.sh

* Added SSH_KEY secret to buildReleaseIncDocker workflow

* Gertting the add SSH_KEY secret into orkflows right this time, hopefully

* Adding TERM env variable and setting USER to medley in docker image

* Debugging medley.ps1 and adding a couple of arguments

* Typo in Dockerfile medley

* Synchronizing flag processing and usage for medley.ps1 and medley.sh; refactored medley_args.sh and medley_usage.sh code.

* Adding first pass at windows installer

* Adding first pass an inno setup script for Windows installation

* Update buildLoadup workflow and downloads page for windows installer

* Fix typo in buildLoadup

* BuildLoadup make sure windows runner uses powershell

* Another typo in buildLoadup

* Another typo in buildLoadup; damn those double quotes

* Updating handling of windows installer in buildLoadup, added vncviewer to medley.iss install

* Unknown syntax error in buildLoadup

* Another damn typo from double quotes

* buildLoadup: fixed loadup job outputs

* buidLoadup: fixed bug with COMBINED_RELEASE_TAG; fixed Upload script in windows job to be compatible with actions.script v6.

* buidLoadup: upload win installer adapted to find draft releases as well as full releases

* BuildLoadup: fixing up javascript in actions in windows job to use / instead of \ in pathname

* BuildLoadup: changing win installer update to same action used for other release assets

* Fix windows installer file name; in BuildLoadup move update downl;oad page to the Windows runner because uploading the window-installer changes the release download url, so updating the downloads page must be done after the windows installer upload.; General buildLoadup cleanup

* Run md2html to update downloads page

* Fix typo in build_deb.sh

* Removing some leftover crud in medley_usage.sh

* Fixing up windows installer a bit, mostly cosmetic

* Adding support for WSL1; mostly forcing --vnc and changing how to find open ports and displays since WSL1 networking is different tha WSL2

* Update manual page for new Windows Medley script

* First pass done for man page that incorporates new Windows medley script.  Add Xvnc wait before calling run-medley in case of docker to prevent occasonal missing X windows server error.

* Change buildLoadup to update man page to a draft if this is a draft run.
This commit is contained in:
Frank Halasz
2023-02-18 06:19:57 -08:00
committed by GitHub
parent 3fa571f798
commit 4b95a8b5d3
32 changed files with 1721 additions and 425 deletions

View File

@@ -49,6 +49,9 @@ on:
required: false
type: string
default: 'false'
secrets:
OIO_SSH_KEY:
required: true
defaults:
run:
@@ -113,6 +116,8 @@ jobs:
######################################################################################
#
# Do the loadup
#
@@ -120,6 +125,12 @@ jobs:
runs-on: ubuntu-latest
outputs:
combined_release_tag: ${{ steps.job_outputs.outputs.COMBINED_RELEASE_TAG }}
medley_release_tag: ${{ steps.job_outputs.outputs.MEDLEY_RELEASE_TAG }}
medley_short_release_tag: ${{ steps.job_outputs.outputs.MEDLEY_SHORT_RELEASE_TAG }}
debs_filename_base: ${{ steps.debs.outputs.DEBS_FILENAME_BASE }}
needs: [inputs, sentry]
if: |
needs.sentry.outputs.release_not_built == 'true'
@@ -143,20 +154,6 @@ jobs:
id: tag
uses: ./../actions/release-tag-action
# Setup environment variables
- name: Setup Environment Variables
id: setup_env
run: |
echo "build_time=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${GITHUB_OUTPUT}
echo "TARBALL_DIR=installers/deb/tmp/tarballs" >>${GITHUB_ENV}
echo "DEBS_DIR=installers/deb/debs" >>${GITHUB_ENV}
echo "TARS_DIR=installers/deb/tars" >>${GITHUB_ENV}
echo "MEDLEY_RELEASE_TAG=${RELEASE_TAG}" >>${GITHUB_ENV}
# Setup some needed dirs in workspace
- name: Create work dirs
run: mkdir -p ${TARBALL_DIR}
# Get Maiko release information, retrieves the name of the latest
# release. Used to download the correct Maiko release
- name: Get Maiko Release Information
@@ -166,6 +163,33 @@ jobs:
owner: ${{ github.repository_owner }}
repo: maiko
# Setup environment variables & establish job outputs
- name: Setup Environment Variables
run: |
echo "build_time=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${GITHUB_OUTPUT}
echo "TARBALL_DIR=installers/deb/tmp/tarballs" >>${GITHUB_ENV}
echo "DEBS_DIR=installers/deb/debs" >>${GITHUB_ENV}
echo "TARS_DIR=installers/deb/tars" >>${GITHUB_ENV}
echo "MEDLEY_RELEASE_TAG=${RELEASE_TAG}" >>${GITHUB_ENV}
echo "MAIKO_RELEASE_TAG=${{ steps.maiko.outputs.latest_tag }}" >>${GITHUB_ENV}
- name: More Environment Variables
run: |
echo "MEDLEY_SHORT_RELEASE_TAG=${MEDLEY_RELEASE_TAG#medley-}" >>${GITHUB_ENV}
echo "MAIKO_SHORT_RELEASE_TAG=${MAIKO_RELEASE_TAG#maiko-}" >>${GITHUB_ENV}
- name: Even More Environment Variables
run: |
echo "COMBINED_RELEASE_TAG=${MEDLEY_SHORT_RELEASE_TAG}_${MAIKO_SHORT_RELEASE_TAG}" >>${GITHUB_ENV}
- name: Establish job outputs
id: job_outputs
run: |
echo "COMBINED_RELEASE_TAG=${COMBINED_RELEASE_TAG}" >> $GITHUB_OUTPUT;
echo "MEDLEY_RELEASE_TAG=${MEDLEY_RELEASE_TAG}" >> $GITHUB_OUTPUT;
echo "MEDLEY_SHORT_RELEASE_TAG=${MEDLEY_SHORT_RELEASE_TAG}" >> $GITHUB_OUTPUT;
# Setup some needed dirs in workspace
- name: Create work dirs
run: mkdir -p ${TARBALL_DIR}
# Download Maiko Release Assets
- name: Download Release Assets
uses: robinraju/release-downloader@v1.6
@@ -174,11 +198,11 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
latest: true
out-file-path: ${{ env.TARBALL_DIR }}
fileName: "${{ steps.maiko.outputs.latest_tag }}-linux.*.tgz"
fileName: "${{ env.MAIKO_RELEASE_TAG }}-linux.*.tgz"
- name: Untar Maiko Release for use in loadup
run: |
tar -xzf "${TARBALL_DIR}/${{ steps.maiko.outputs.latest_tag }}-linux.x86_64.tgz"
tar -xzf "${TARBALL_DIR}/${{ env.MAIKO_RELEASE_TAG }}-linux.x86_64.tgz"
# Checkout Notecards and tar it in the tarballsdir
- name: Checkout Notecards
@@ -192,7 +216,7 @@ jobs:
cd ..
tar cfz medley/${TARBALL_DIR}/notecards.tgz notecards
#
# Install vnc
- name: Install vnc
run: sudo apt-get update && sudo apt-get install -y tightvncserver
@@ -202,7 +226,7 @@ jobs:
export DISPLAY=":0"
PATH="$PWD/maiko:$PATH"
scripts/loadup-all.sh -apps
- name: Build loadups release tar
run: |
cd ..
@@ -240,11 +264,16 @@ jobs:
medley/internal
# Build the deb files as well as the tgz files
- name: Build .deb files for 3 architectures
id: debs
run: |
cd installers/deb
./build_deb.sh
debs_filename_base=$(./build_deb.sh)
echo "DEBS_FILENAME_BASE=${debs_filename_base}" >> $GITHUB_ENV;
echo "DEBS_FILENAME_BASE=${debs_filename_base}" >> $GITHUB_OUTPUT;
# Push the release up to github releases
- name: Delete existing release with same tag (if any)
uses: cb80/delrel@latest
with:
@@ -267,41 +296,114 @@ jobs:
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update the downloads page and the man page to the OIO satic page host
#
# Create the Windows installer, push it up to the release on github and
# update the downloads page on OIO
#
windows_installer:
runs-on: windows-latest
needs: [inputs, sentry, loadup]
if: |
needs.sentry.outputs.release_not_built == 'true'
|| needs.inputs.outputs.force == 'true'
steps:
# Checkout latest commit
- name: Checkout Medley
uses: actions/checkout@v3
# Store the values output from loadup job as environment variables
- name: Environment Variables
shell: powershell
run: |
maiko_release_tag="${{ steps.maiko.outputs.latest_tag }}"
medley_short_release_tag="${MEDLEY_RELEASE_TAG#medley-}"
full_release_filename="${MEDLEY_RELEASE_TAG/medley/medley-full}_${maiko_release_tag#maiko-}"
# Need info about where github stores assets because draft releases are not tagged
release_url="${{ steps.push_release.outputs.html_url }}"
github_subdir="$( echo "${release_url}" | sed -e "s#^.*/\([^/]\+\)\$#\1#g" )"
#
$crt="${{ needs.loadup.outputs.combined_release_tag }}"
echo "COMBINED_RELEASE_TAG=$crt" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
$mrt="${{ needs.loadup.outputs.medley_release_tag }}"
echo "MEDLEY_RELEASE_TAG=$mrt" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
$msrt="${{ needs.loadup.outputs.medley_short_release_tag }}"
echo "MEDLEY_SHORT_RELEASE_TAG=$msrt" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
$debs="${{ needs.loadup.outputs.debs_filename_base }}"
echo "DEBS_FILENAME_BASE=$debs" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
# Download vnc viewer
- name: Download vncviewer
shell: powershell
run: |
$url = "https://sourceforge.net/projects/tigervnc/files/stable/1.12.0/vncviewer64-1.12.0.exe"
$output = "installers\win\vncviewer64-1.12.0.exe"
(New-Object System.Net.WebClient).DownloadFile($url, $output)
# Run iscc.exe to compile the installer
- name: Compile medley.iss
shell: powershell
run: |
iscc installers\win\medley.iss
$filename="medley-install_${env:COMBINED_RELEASE_TAG}_x64.exe"
echo "INSTALLER_FILENAME=$filename" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
# Upload windows installer to release
- name: Upload windows installer to release
id: push
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: installers/win/${{ env.INSTALLER_FILENAME }}
tag: ${{ env.MEDLEY_RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
# Install the OpenSSH Client
- name: Install the OpenSSH Client
shell: powershell
run: |
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
# Update the downloads page and the man page on OIO
- name: Update the downloads page and the man page to the OIO static page host
shell: bash
run: |
# Figure out filenames
download_url="${{ steps.push.outputs.html_url }}"
download_url="${download_url/\/tag\//\/download\/}"
local_template="installers/downloads_page/medley_downloads.html"
local_filename="medley_downloads.html"
local_manpath="docs/man-page/man_medley.html"
if [ "${{ needs.inputs.outputs.draft }}" = "true" ];
then
remote_filename="draft_downloads"
remote_manname="man_draft.html"
else
remote_filename="${local_filename%.html}"
remote_manname="man_medley.html"
fi
remote_filepath="/srv/oio/static/${remote_filename}"
remote_manpath="/srv/oio/static/${remote_manname}"
# Fill in downloads page template
sed \
-e "s/@@@FULL.RELEASE.FILENAME@@@/${full_release_filename}/g" \
-e "s/@@@GITHUB.SUBDIR@@@/${github_subdir}/g" \
-e "s/@@@MEDLEY.SHORT.RELEASE.TAG@@@/${medley_short_release_tag}/g" \
-e "s/@@@MEDLEY.SHORT.RELEASE.TAG@@@/${MEDLEY_SHORT_RELEASE_TAG}/g" \
-e "s~@@@DOWNLOAD_URL@@@~${download_url}~g" \
-e "s/@@@DEBS.FILENAME.BASE@@@/${DEBS_FILENAME_BASE}/g" \
-e "s/@@@WINDOWS.INSTALLER.FILENAME@@@/${INSTALLER_FILENAME}/g" \
< "${local_template}" > "${local_filename}"
local_manpath="docs/man-page/man_medley.html"
remote_manpath="/srv/oio/static/man_medley.html"
# Create sftp instruction file
echo "-rm ${remote_filepath}.oldold" > batch
echo "-rename ${remote_filepath}.old ${remote_filepath}.oldold" >> batch
echo "-rename ${remote_filepath}.html ${remote_filepath}.old" >> batch
echo "-put ${local_filename} ${remote_filepath}.html" >> batch
echo "-put ${local_manpath} ${remote_manpath}" >> batch
# Do the sftp
eval $(ssh-agent)
ssh-add - <<< "${SSH_KEY}"
sftp -o StrictHostKeyChecking=no -b batch ubuntu@online.interlisp.org
env:
SSH_KEY: ${{ secrets.OIO_SSH_KEY }}
######################################################################################
@@ -316,7 +418,7 @@ jobs:
outputs:
build_successful: ${{ steps.output.outputs.build_successful }}
needs: [inputs, sentry, loadup]
needs: [inputs, sentry, loadup, windows_installer]
steps:
# Checkout the actions for this repo owner
@@ -340,3 +442,21 @@ jobs:
echo "build_successful='true'" >> $GITHUB_OUTPUT
######################################################################################
# - name: Download the Windows installer created in windows job
# uses: actions/download-artifact@v3
# with:
# name: windows_installer
# path: installers/win
# - name: Rename the Windows installer w/ version tag
# run: |
# maiko_release_tag="${{ steps.maiko.outputs.latest_tag }}"
# combined_release_tag="${MEDLEY_RELEASE_TAG#medley-}_${maiko_release_tag#maiko-}"
# windows_installer_filename="medley_install_${combined_release_tag}_x64.exe"
# cd installers/win
# mv medley_install_vXXXVERSIONXXX_x64.exe "${windows_installer_filename}"
# echo "WINDOWS_INSTALLER_FILENAME=${windows_installer_filename}" >>${GITHUB_ENV}